Skip to content
Learn Netverks

Lesson

Step 15/36 42% through track

lifting-state

Lifting state up

Last reviewed May 28, 2026 Content v20260528
Track mode
client_react
Means
In-browser React TSX
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Lifting state up: the concepts, APIs, and habits you need before advancing in React.

Local component state is the backbone of interactive UI; mistakes here cause subtle re-render bugs.

You will apply Lifting state up in contexts like: SPAs, dashboards, design-system-driven products, and React Native mobile apps.

Write TypeScript/TSX, click Run in browser—React 18 loads from CDN, JSX compiles in the tab, UI renders in the preview root, and printOutput feeds the terminal.

When you can explain the previous lesson's ideas without copying starter code.

When two sibling components must show the same data, move shared state to their closest common parent and pass values down as props plus callbacks to update.

Why lift state?

  • Avoid duplicating state that can drift out of sync
  • Keep a single source of truth for filters, selection, or theme
  • Enable parent to coordinate multiple children (master/detail layouts)

Data flow reminder

State flows down via props; events flow up via functions like onSelect(id). This one-way flow makes debugging tractable.

Self-check

  1. Which component should own shared filter state—a list, a search box, or their parent?
  2. How does a child request a state change after lifting?

Tip: Lift only as high as needed—if only one branch needs the value, keep state in that branch.

Interview prep

When do you lift state?

Move shared state to the closest common ancestor when two siblings need the same value. Colocate first; lift only when a second consumer appears.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What state did you lift?
  • Sibling that benefited?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump