News for hackers. Stuff that matters.
Re:The Plan for React 18 by bern4444 on Tuesday June 08, 2021 @03:58PM (#27439992)
I’m sure the parent author knows this

But the beauty of hooks is as you say reusable statefull behavior. It also lets you treat your functional components more like a pure function in my opinion.

If the hooks you use are poorly designed, then yeah, it may be more difficult. But well designed and implemented hooks make your component appear more like a pure function.

The state is (more) decoupled from the UI code than before and lets me easily reuse behaviors across components.

There are no comments on this comment yet.