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:
Use Router outside of your components. Wrap all components inside the Router then will able to use Link in your components.
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
<Router>
<Appbar />
<Switch>
<Route exact path="/" component={Home} />
<Route path="/mac" exact component={Mac} />
</Switch>
<Footer />
</Router>
Trouble with 2 instance of React