DEV Community

Discussion on: React Ref to add className

Collapse
 
goran7777 profile image
Goran

This is unusable,i cant add class with refs on socket event at all.I ask myself if we cant add simple class on some socket event ,why refs exists?

Collapse
 
0liviermartinez profile image
Olivier Martinez

Right ??
Vue let's you do that.

this.$refs['some-ref'].$el.classList.add('some-class')