5 ms·
Hooks are not simple at all, are very error prone, and definitely do not put the user in the "pit of success". JSX is terrific, but React has only gone backward
by linkgoron 5y ago
Hooks are not simple at all, are very error prone, and definitely do not put the user in the "pit of success". JSX is terrific, but React has only gone backwards since classes IMO.
- pohl 5y agoNot a react fan, here, but hooks are so much better than pre-hooks react. Not sure why anyone would want to go back.
- _fat_santa 5y agoHighly highly disagree. Hooks and Functional components are so much easier to work with nowdays then class based components that came before.
- willio58 5y agoAgreed. Ever since I started writing functional components only I’ve found less bugs make their way into my code.
- chrisco255 5y agoThe main gotcha with hooks is declaring dependencies for re-renders. It does not take very long long to learn, and it certainly is simple to fix once the problem is realized. One of the nicest things about hooks + functional components is how much easier it is to refactor. With class based components, nested state and lifecycle behavior made it sometimes difficult to break down complex components. But I feel like with functional components and hooks, refactoring into logical subcomponents is a breeze.
- linkgoron 5y agoI believe that React's hooks implementation is sub-par, not that "a" hooks implementation wouldn't work. Their current implementation badly needs a real compiler (the whole dependencies array stuff is atrocious, as well as some of the useMemo/useCallback performance issues), or a totally different approach that is actually reactive (e.g. SolidJS). IMO the burden of their implementation on the developer is too large.