I'm using react-router version 5.5.1 and am trying to use it in my index.js
file:
./src/index.js
14:8-21 'react-router' does not contain an export named 'BrowserRouter'
The import statement within my index.js
:
import { render } from 'react-dom';
import { BrowserRouter, Match, Miss } from 'react-router';
BrowserRouter: BrowserRouter is a router implementation that uses the HTML5 history API(pushState, replaceState and the popstate event) to keep your UI in sync with the URL. It is the parent component that is used to store all of the other components.
At the core of every React Router application should be a router component. For web projects, react-router-dom provides <BrowserRouter> and <HashRouter> routers. The main difference between the two is the way they store the URL and communicate with your web server. A <BrowserRouter> uses regular URL paths.
you need to import BrowserRouter
from react-router-dom
import { BrowserRouter } from 'react-router-dom'
more info about BrowserRouter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With