|
|
|
|
|
by MiddleMan5
1564 days ago
|
|
Slightly dismissive, but I agree the setInterval function was a little misleadingly contrived. The transition to functional components was to reduce the coupling between abstract functionality and DOM-related lifecycle events. React hooks are mostly about expressing where and when you want to memoize a value, with the default being not to. Once you learn what to look out for, and properly designing and review codebases at scale, these trivial issues don't happen all that often. Additionally, being able to specify memoization parameters explicitly brings extra flexibility and some additional design patterns. |
|
https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-...