Create Basic Routes with the React Router v4 BrowserRouter

Joe Maddalone
InstructorJoe Maddalone

Share this video with your friends

Send Tweet

React Router 4 has several routers built in for different purposes. The primary one you will use for building web applications is the BrowserRouter. In this lesson you will import the BrowserRouter and create some basic Route components.

Jason
Jason
~ 3 years ago

For lesson #1, get App.js from github rather than the video.

It'd be a good egghead.io feature to notify the user watching the video that the code show is out of date.

Mickey
Mickey
~ 3 years ago

Hi, You've added react-router-dom as a dev dependency. However the router will be being used for routing in production as well. Should it have been added as a --save instead of as a --save-dev?

Roland Pangu
Roland Pangu
~ 2 years ago

Hi, You've added react-router-dom as a dev dependency. However the router will be being used for routing in production as well. Should it have been added as a --save instead of as a --save-dev?

Yes you'd want to do a --save, also looks like version 5.0.1 allows you to render a component directly with the component attribute of the Route component