UseEffect is a bad place to make API calls on useEffect. The design choices react team have made in useEffect hook are still a heated debate. The default behaviour is the dreaded ‘Infinite Render Loop’ which is pretty easy to run into.

2m read timeFrom medium.com
Post cover image
Table of contents
Why useEffect is a bad place to make API callsThe strict mode problemThe performance problemReact Query to the rescueConclusionReferences:
8 Comments

Sort: