0Pricing
React Academy · Lesson

Choosing the Right State Location

Apply a decision framework: local state, lifted state, or global state.

Welcome

In this lesson you will learn a practical decision framework for deciding whether state belongs in a single component, a common ancestor, React Context, or a global state library.

Step 1: Who Uses This State?

First ask: which components render using this state? List them. If only one component uses it, keep state local in that component.

All lessons in this course

  1. Lifting State Up: Principles & Examples
  2. Prop Drilling: When It Hurts & When It's Fine
  3. Sibling Communication Patterns
  4. Choosing the Right State Location
← Back to React Academy