0PricingLogin
React Academy · Lesson

Distinguishing Server Data and Local UI State

Separate server data (fetched, cached, refreshed) from ephemeral UI state (open panels, inputs). Keep logic clear and updates predictable.

Two kinds of state

Goal: Don’t mix server data with local UI.

  • Server data: fetched, cached, refreshed
  • Local UI: view flags, inputs, filters
  • Separate concerns → simpler code

Rules of thumb

  • If data comes from an API and can be refetched, treat it as server state.
  • If it controls the view only, keep it local.
  • Keep fetch status (idle/loading/error) near the server data.

All lessons in this course

  1. Distinguishing Server Data and Local UI State
  2. Normalization & Optimistic Updates (Concepts)
  3. Sync Patterns Without Heavy Libs
← Back to React Academy