Sharing State Flashcards

1
Q

What are two ways React components can interact?

A

props and callbacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can multiple React components share state?

A

moving it up to the closest common ancestor of the components that need it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When would you want to lift state up?

A

when several components need to reflect the same changing data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly