3 ms·
It is complicated, and React doesn't help, especially since it started calling useEffect with an empty dependencies array twice in strict mode in React 18. Davi
by azangru 4y ago
It is complicated, and React doesn't help, especially since it started calling useEffect with an empty dependencies array twice in strict mode in React 18. David Khourshid (of XState) has been going to conferences talking about how to use (or, preferably, not to use) the useEffect[0].
[0] - Here's one of his most recent talks: https://www.youtube.com/watch?v=eFGeStq8dZo https://www.youtube.com/watch?v=eFGeStq8dZo