News for hackers. Stuff that matters.
Re:Hooks Considered Harmful by adamddev1 on Monday March 21, 2022 @12:54PM (#30756478)
I also liked/like the idea of one state object. With hooks now they really discourage packing everything into one state object and you either have to use a bunch of different `useState` statements for your different variables or pack a big state object in one `useState` but then you face big performance issues with needless re-renders when you only change one element of the state object.
Re:Hooks Considered Harmful by andsbf on Monday March 21, 2022 @03:49PM (#30758855)
Take a look at useReducer(no 3rd package, part of the React api)