Sharing State Flashcards
1
Q
What are two ways React components can interact?
A
props and callbacks
2
Q
How can multiple React components share state?
A
moving it up to the closest common ancestor of the components that need it
3
Q
What are the steps to “lift state up”?
A
moving it up to the closest common ancestor of the components that need it. This is called “lifting state up”
4
Q
When would you want to lift state up?
A
when several components need to reflect the same changing data