Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The issue I have with the "rules of hooks" is that it makes some previously trivial things cumbersome at best, and downright complicated at worst. For a quick example, something as simple as mapping an array onto a series of elements with a callback requires (as far as I can tell) that the inner element be broken out into its own component that calls `useCallback`, since you can't create a unique callback for each item in the parent.



You don't need to use hooks there. You can just define your functions and be done with it.


You do if you don't want those child components to be re-rendered needlessly when some higher-level state changes.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: