September 2018
Beginner
156 pages
3h 28m
English
The core react-router package can be installed via npm:
npm install --save react-router
The Router class can then be included in the application file:
import { Router } from 'react-router'
The next step is to create a history object that can then be provided as a value to the history prop of <Router>:
import createBrowserHistory from 'history/createBrowserHistory';const customHistory = createBrowserHistory()
Here, the createBrowserHistory class from the history package is used to create a history object for the browser environment. The history package includes classes suitable for various environments.
The last step is to wrap the application's root component with the <Router> component and render the ...
Read now
Unlock full access