News for hackers. Stuff that matters.
Re:useStateMachine: A ½ kb state machine hook for React by Waterluvian on Saturday May 22, 2021 @12:55PM (#27248278)
Not only this but I need the freedom to control the dependency list for an effect. Sometimes it isn't as simple as "every variable being referenced inside the effect."
Re:useStateMachine: A ½ kb state machine hook for React by MispelledToyota on Saturday May 22, 2021 @09:56PM (#27251836)
that's a bit confusing. While you can sometimes get away with leaving out dependencies, and then you don't have to useMemo or useCallback as often, it seems like there is a much larger downside to having potentially stale values in your effect. Leaving them out to me would result in the potential for weird future bugs and race conditions.