Join Alex Banks for an in-depth discussion in this video Adding a NotFoundRoute handler, part of Building a Polling App with Socket IO and React.js.
- When you open the browser and type in an incorrect route…into the location bar, nothing happens.…We need to let our users know, "Whoops!…"There's been a mistake," and help redirect them…to the appropriate route.…So, the first thing that we want to do is…create a Whoops404 component that will be displayed…when we don't know what route is being requested.…So I'm going to to up into my components here,…and I'm going to right-click over components…and select New File.…And I'm going to immediately save this file…as Whoops404.js.…
So now we're going to go ahead and create this component.…Just like any other, we need React.…Now let's just go ahead and code the Whoops404 component.…Whoops404…React.createClass,…and just like every component, we need the render function.…And just like every component that we've built,…we're using that ES6 syntax for the render function.…So now what I want to return is information to my user…that we don't know what they're looking for.…So, we will place all of this info in a div.…
I'll give it an id of not-found,…
- 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
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.