Join Alex Banks for an in-depth discussion in this video Creating a display component, part of Building a Polling App with Socket IO and React.js.
- The neat thing about React is that…we can create reusable helper components…that allow us to hide any complex implementation…in an easy-to-use component.…In this lesson, we're going to create a display component…that we can wrap around a group of children…and display them based upon a condition…that we send to the component as a property.…So to get started, I'm going to go over…to my components folder and expand that,…and then go into my parts folder,…and I will add this file here.…I'm going to right-click over the parts folder…and select New File,…and then I will instantly save this file as Display.js.…
Now, consider our traditional if-else statement.…If a condition is true, then we can return…"The condition is true."…Otherwise, we can return…"The condition is false."…So this is our classic if-else statement.…Now, in React, it gets kind of tricky…to write if-else statements like this with JSX.…So we have a great helper,…the shorthand if-else statement.…Instead of returning "The condition is true"…or returning "The condition is false,…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.