Q36: What is State Colocation in React application architecture?

State Colocation is the practice of keeping state as close as possible to where it is actually used. Elevating state globally unnecessarily causes distant unrelated component trees to re-render.

Key Takeaways
  • Keep state localized to the nearest common ancestor that requires it.

  • Prevents global state pollution and eliminates widespread re-render cascades.

Knowledge Check

What is the main performance benefit of state colocation?