← Quiz: React Basics: all 10 questions
Quiz: React Basics · Question 9 of 10
Two sibling components need the same data. Where should the state live?
Two sibling components need the same data. Where should the state live?
- A.In both siblings, kept in sync manually
- B.In their nearest common parent, passed down as props
- C.In a global variable
- D.In the CSS
Answer & explanation
Correct answer: In their nearest common parent, passed down as props
This is lifting state up.
Can you get the rest right without peeking?
Take the timed Quiz: React Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →