I use react-router-dom for routing in my React application. Part of my app extracted in another package. List of dependencies looks like this:
react-router-dom
React
Using the tag in a component that doesn't have the imported could give this error, try importing the BrowserRouter from 'react-router-dom'
BrowserRouter
'react-router-dom'
import {BrowserRouter , Link} from 'react-router-dom';
then make sure to wrap your linked tags in the tag