The <BrowserRouter> component was discussed briefly in the first chapter. As the name suggests, the <BrowserRouter> component is used in browser-based applications and it uses HTML5's history API to keep the UI in sync with the browser's URL. Here, we take a look at how the component creates a history object for the browser environment and provides this history object to the <Router>.
The <BrowserRouter> component accepts the following props:
static propTypes = {
basename: PropTypes.string,
forceRefresh: PropTypes.bool,
getUserConfirmation: PropTypes.func,
keyLength: PropTypes.number,
children: PropTypes.node
};
Similar to the <Router> interface, the <BrowserRouter> accepts only one child component (usually the application's root component). The children prop mentioned in the preceding...