🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.In both siblings, kept in sync manually
  2. B.In their nearest common parent, passed down as props
  3. C.In a global variable
  4. 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 →