September 2018
Beginner
156 pages
3h 28m
English
The react-router-dom package includes a <BrowserRouter> component, which is used as a wrapper before adding routes in the application. To use React-Router in the React Native application, the react-router-native package is used. This will be discussed in detail in later chapters. The <BrowserRouter> component is an implementation of the router interface that makes use of HTML5's history API to keep the UI in sync with the URL path.
The first step is to wrap the application's root component with <BrowserRouter>, as shown here:
import { BrowserRouter } from 'react-router-dom';ReactDOM.render( <BrowserRouter> <App /> </BrowserRouter>, document.getElementById('root'));
Wrapping your application inside <BrowserRouter> ...
Read now
Unlock full access