React useEffect fetching twice in development is Strict Mode, not a bug in production
@devsingh05▲ 7 net votes
React 18+ Strict Mode mounts, unmounts and remounts components in development to surface missing cleanup, so effects run twice and you see duplicate requests. Production builds run them once. Add cleanup (an AbortController or an ignore flag) so the double run is harmless, or use a data library such as TanStack Query that deduplicates requests.