When Client Fetching is Actually Right
You'll learn: When using useEffect for data fetching is genuinely the correct architectural choice, despite the performance concerns.
Not Everything Belongs on the Server
We've covered the downsides of client-side fetching—waterfalls, loading spinners, wasted renders—but sometimes fetching in useEffect is actually the right tool. Not every data request should be hoisted to the server or preloaded.
Legitimate Use Cases
User Interactions
When data depends on a user action—clicking a button, opening a modal, expanding an accordion—you can't fetch it on the server. The server doesn't know what the user will click. This data lives in useEffect or event handlers.
Real-Time Updates
Polling for notifications, live sports scores, or chat messages requires continuous client-side requests. The server rendered the initial page, but the live data stream happens in the browser.
Client-Only State
If your fetch depends on localStorage, scroll position, mouse coordinates, or other browser-only state, it must happen client-side. The server has no access to these values.
Progressive Enhancement
Sometimes you render a useful page immediately and fetch "nice-to-have" data afterward. The initial HTML works, and the client fetch enhances it. This is a deliberate choice for better perceived performance.
The Rule of Thumb
Ask: "Could this data be available before the user sees the component?" If no—because it depends on user input, real-time sources, or browser state—then client fetching is correct.
Key Takeaway: Client-side useEffect fetching isn't always wrong—it's the right choice when data depends on user interactions, real-time updates, or client-only state that the server can't access.