top | item 44716981

(no title)

hyfgfh | 7 months ago

The useRef pattern seem like a code smell, maybe because I had some troubles with refs over the years.

Things were simpler when we had lifecycle methods to manage some of this things. But I`m sure that the next version of react will change everything and make us come up with more patters to try to fix the same problem again...

discuss

order

skydhash|7 months ago

useRef is quite useful when you want to use something externally that has it own lifecycle. And your only interaction is sporadic. Think animation.