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.
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: