3 ms·
React still rocks, as it keeps "magic" to the minimal (Hook introduces a little magic for a tradeoff). Simplicity is key here.
by revskill 5y ago
React still rocks, as it keeps "magic" to the minimal (Hook introduces a little magic for a tradeoff).
Simplicity is key here.
- smt88 5y agoHooks are not simple. I have yet to find a dev who doesn't make subtle mistakes with them on a regular basis. I think the concept of hooks is fine, but JS/TS is an insane language and requires an enormous amount of discipline to write.
- linkgoron 5y agoHooks 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.