Concept

Local vs Global State

When useState is fine and when it isn't.

The default mistake on mobile is reaching for global state too early. useState in the screen that owns the data is correct most of the time. You graduate to global (Zustand, Jotai, context) when the data is shared across screens that don't share an ancestor — auth, theme, cart.

The agent will reach for a state library if you don't tell it not to. State your default in CLAUDE.md: "Prefer useState. Only use Zustand for truly global state — auth, theme, current user."

Check your understanding
Q1. When does global state actually pay off on mobile?
· Score 100% on the quiz.