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 Basics!
You have completed React Basics!
Preview
In this video, we'll set up the Item component to receive props and pass props down to the Counter component. This will make the Item component dynamic and reusable.
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
Props pass data from a parent
component down to a child component.
0:00
In our example, within the App component,
0:03
we pass data to the Header component
through the title and itemTotal props.
0:06
The Header component then uses these
props to display the appropriate content.
0:11
Let's continue with defining props for
the Item and Counter components.
0:18
The Item component should display
the name of an item, while the Counter
0:23
component needs to display
the quantity alongside the buttons.
0:28
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