Render Cost And State Boundaries
Pack:
reactParent skill: React Render Performance And State Boundaries Source:react/react-render-performance-and-state-boundaries/references/render-cost-and-state-boundaries.md
Default order of attack
Section titled “Default order of attack”- Identify the state change
- Reduce who depends on it
- Split hot and cold UI
- Re-measure
- Memoize only if needed
Good default boundaries
Section titled “Good default boundaries”- local form state stays local
- hover and open state stay near the interactive component
- expensive lists get isolated from unrelated page state
- providers stay narrow when their values change often
Bad default boundaries
Section titled “Bad default boundaries”- root-level client state for one local interaction
- large providers wrapping the app for frequently changing values
- derived state copied into multiple components