6 ms·
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 man
by hyfgfh 1y 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...
- skydhash 1y agouseRef is quite useful when you want to use something externally that has it own lifecycle. And your only interaction is sporadic. Think animation.