useEffect runs twice in dev — is my cleanup wrong or is it StrictMode?
React 18.3, my fetch effect fires twice in development and I see two requests in the network tab. The cleanup function aborts the first request, but the server still receives it. In production the build seems to fire once. Should I remove StrictMode or change the effect?
3 replies