React 18 useEffect Double Call for APIs: Emergency Fix

added by JavaScript Kicks
6/6/2022 12:57:23 PM

944 Views

So you've upgraded to React 18, enabled strict mode, and now all of your useEffects are getting called twice. Which would normally be fine, but you have API calls in your useEffects so you're seeing double traffic in development mode. Sound familiar? No problem, I've got your back with a bunch of potential fixes.


0 comments