Hacker News new | ask | show | jobs
by hyfgfh 319 days 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...

1 comments

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