Re:useStateMachine: A ½ kb state machine hook for React
by azangru on Saturday May 22, 2021 @11:01AM
(#27247168)
Notice the words "pass to useEffect" in the parent comment, and the code snippet in the grandparent they are commenting on. The type of the callback function that useEffect accepts is () => void rather than () => Promise<unknown>. What's not true about that?
[ Parent
| on HN ]
Re:useStateMachine: A ½ kb state machine hook for React
by jakelazaroff on Saturday May 22, 2021 @11:06AM
(#27247214)
I reworded it to make it a bit more clear (at least, I thought so) — "pass an async function to useEffect", meaning the argument supplied to useEffect itself, rather than "use directly within" which is ambiguous. Re-added "directly" to hopefully make even more clear. Sorry for the confusion!