Join Alex Banks for an in-depth discussion in this video Adding a default title, part of Building a Polling App with Socket IO and React.js.
- The first state variable that we will handle is…the presentation title.…Let's create a default title variable on the server…and pass its value all the way to the client.…So to do this I'm going to open up the app-server.js file,…and right down here on line five,…right below our connections,…this is where I'll create the title variable.…And we'll set this title to Untitled Presentation.…Great!…So this title variable will change when a speaker connects…and sets the title, but for now let's pass this…Untitled Presentation value all the way…to the client when they connect.…
So when there's a new connection,…here's the callback function that fires here on line 13.…So I can place this anywhere in here.…I'm going to do it right before we push the connections…here on line 20.…So when a user connects, I am going to throw…some information back to them using emit.…Socket.emit is what we use to emit events…that can be handled by the client.…So we are going to emit a custom event here;…this will be called "welcome".…And this welcome event, when it fires,…
- 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
Learn React.js: The Basics (2015)with Eve Porcello1h 32m Beginner
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.