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.
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.
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?
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