News for hackers. Stuff that matters.
Re:useStateMachine: A ½ kb state machine hook for React by aphextron on Saturday May 22, 2021 @08:19PM (#27251411)
>but note that then there’s no way of accessing updates values (in callbacks)

This is by design. When you start making a component worry about what it needs to do on an update, rather than just rendering its data, you are introducing a whole new level of complexity. That's why class based React components could turn into these unwieldy confusing things where you never knew for certain what was going to render every time, because the shouldComponentUpdate method gets stuffed full of business logic.

There are no comments on this comment yet.