Skip to content

Laboratory · React Lab

State placement experiment

Briefing

Where should state live: at the top for convenience, or as low as possible for performance?

The same feature, built three times. Only the location of one `useState` changes. The performance profile does not survive it.

Laboratory
React Lab
Level
DEVELOPER
Estimated time
8 minutes
Method
interactive
Variables under observation
lifting statecolocationderived staterender scope