3 ms·
I've used hooks in 3 different teams now, each team had engineers who weren't really familiar with React before using it with hooks. The only thing I've notice
by sunaurus 6y ago
I've used hooks in 3 different teams now, each team had engineers who weren't really familiar with React before using it with hooks.
The only thing I've noticed is that built-in hooks with dependency arrays consistently caused confusion for newbies - for some reason, people aren't used to thinking in terms of "call this function every time this data changes", but they are very used to thinking in terms of "call this function on initial page load" for example. The second way of thinking will probably lead to bugs or just weird code. Other than that (relatively tiny) hurdle, I don't think I've noticed any other common issues with understanding hooks.
I would be very interested in hearing specific examples of cases where hooks have worked in confusing or unexpected ways.
- ZephyrBlu 6y agoI think the paradigm of thinking in terms of your data rather than your code is what throws a lot of people off with hooks, but it makes infinitely more sense to me.