Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed React Components!
You have completed React Components!
Preview
When two or more components need access to the same state, we move the state into their common parent. This is called "lifting state up".
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
player component through props.
0:00
Our application currently has two
stateful components, App and Counter.
0:06
But this is not a great overall
structure for our application.
0:12
In the React basics course,
0:17
you learned how to create a simple stateful
component like the Counter component.
0:18
The state of the Counter
is the player score,
0:24
which is currently local to the component.
0:26
This state isn't available to other
components in the app, which makes it
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up