Hacker News new | ask | show | jobs
by kylorhall 1700 days ago
I think if you use them 100% of the time alongside eslint dependency arrays are really hard to get wrong. If you rarely use them, you always get them wrong.
1 comments

If you just blindly follow the eslint suggestions you can very easily wind up with render loops. You need to carefully consider and understand the dependencies in each case. And if you want to do something specific when only one of your dependencies changes you need even more gymnastics.
The reason you end up with render loops is usually because you didn’t memo something. If you memo everything you can avoid that issue.