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 by Example!
You have completed React by Example!
Preview
This video covers one solution to the filter bug we spotted in the previous video.
This video doesn't have any notes.
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
Remember, I needed a unique ID value, so
I started by creating a count variable,
0:00
in App.js, named lastGuestId and
set it to 0 by default.
0:02
Then I wrote a method called newGuestId
that increments the count and
0:06
returns it value.
0:12
Then, down in the newGuestSubmitHandler,
0:13
I use this method to supply unique
ids to newGuests as they're created.
0:17
So, as you can see it's adding the id
to each new guest object and state.
0:22
Now that guest had an ID I went
into the guest list component and
0:27
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