The Double-Fetch Network Waterfall
What you'll learn: Why you sometimes see two identical network requests fire back-to-back in development mode, and why it's actually intentional.
When you open your browser DevTools Network tab in development mode with StrictMode enabled, you might notice something alarming: your useEffect data fetch fires twice in quick succession. This creates a visible "waterfall" pattern in the network timeline — two requests for the same data, one right after the other.
Why This Happens
StrictMode intentionally double-mounts your components in development. This means:
- Component mounts → Effect runs → Fetch starts
- Component unmounts (StrictMode simulation) → Cleanup runs
- Component mounts again → Effect runs again → Second fetch starts
You end up with two fetch requests happening almost simultaneously, which looks like a bug but is actually React helping you catch cleanup issues.
The Network Tab Shows the Reality
In your Network tab, you'll see:
- Request #1 starts at 0ms
- Request #2 starts at ~10ms (before #1 finishes)
- Both complete around the same time, creating a "double waterfall"
This only happens in development with StrictMode. In production, your effect runs once and you get one fetch.
Why It's Actually Helpful
The double-fetch reveals whether your cleanup logic works correctly. If you're using an ignore flag or AbortController, that first fetch should either be ignored or cancelled — exactly what you want to test before shipping to production.
Key Takeaway: The double-fetch waterfall in development is StrictMode's way of stress-testing your effect cleanup. It looks weird in the Network tab, but it's ensuring your component handles rapid mounting/unmounting correctly — a situation that happens in real apps with navigation or Suspense boundaries.