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
In this video, we'll finish writing the handleScoreChange function by updating state based on the index of a player object.
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
For starters, I'll set
the handleScoreChange function to accept
0:00
the id of the player whose score should
change just before the delta parameter.
0:01
Before making any changes to the state,
I'll console.log the id and
0:08
the delta to test if this works.
0:13
The players id is already been
passed down to the Player component.
0:22
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