0
Challenge · 20React Core

Lifting State Up

Coreused in ~90% of apps

When two components need the same data, the answer is almost always: move the state up.

Core idea. Put shared state in the closest common parent and pass it down as props (plus callbacks to change it).
Playground, this isn't a screenshot
Live demointeractive
Composer (child)
Feed (sibling child)
  • Posts live in the PARENT
↑ play a little first, then dig in