State Management · Junior · Question 8 of 75
What is "local" (component) state and when is it enough?
- ✓Correct answer: State used by one component or a small subtree -
useStateis enough - 2State stored in
localStorageto survive reloads - 3State that only server components can hold
Explanation
Most UI state is local: whether a dropdown is open, an input's text, the active tab. Keep state as close as possible to where it's used, and lift it up or move it into a store only when several distant components need it.