Configure the App to Use react-router
Learn to configure react-router in React applications.
We'll cover the following...
This lesson covers the steps to configure and add react-router
in a React application. It also introduces several types of routers that react-router
provides.
Add react-router to a React app
In order to use react-router
in the application, we need to connect it to the router element. To do this, we need to wrap the app or root element of the application inside the router element. This allows us to use the routing functionalities anywhere in the application. Before doing that, however, let’s review the router component.
What is the router component?
The router component is the core component of the react-router
. Behind the scenes, it uses React Context to pass routing props to any component inside the application. In ...