Join Alex Banks for an in-depth discussion in this video Passing state to child components as properties, part of Building a Polling App with Socket IO and React.js.
- Any properties that we need to pass to the…audience, speaker and board components…need to be passed through the route handler.…Since all of our data is going to be saved…to the state of our app component,…we will need to pass this information as…properties to the route handler.…So let's go ahead and open up our app component…in the Components directory.…So, we have already passed the current state…of the status and the title down to the header,…but we haven't passed that state down to…the board or the audience, or the speaker components.…
So, we are going to be passing the state…down to the child components as properties,…so let's just go ahead and pass the title…to the route handler.…And let's go ahead and also pass the status.…Great.…So now we've passed the title and the status…down to the route handler,…which means that the variables will be…passed down to any of those child components…as properties.…So let's go and use one of these variables.…I'm going to go ahead and open up…the "audience" component.…And what I'm going to do, just for the fun of it,…
- Setting up the environment
- Connecting sockets
- Handling disconnects
- Setting up the React.js router
- Passing state to child components as properties
- Joining the presentation
- Starting and running the presentation
- Asking and answering questions
- Graphing results
- Upgrading to ES6
Skill Level Intermediate
Building a Responsive Single-Page Design with Sasswith Ray Villalobos4h 55m Intermediate
1. Setting Up the Environment
Setting up npm scripts4m 22s
2. Connecting Sockets
3. App State and Routes
4. Joining the Presentation
5. Starting the Presentation
6. Questions and Answers
7. Graphing Results on a Scoreboard
8. Upgrading to ES6 Syntax
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.