When I click a Link, the url changes, but the content of the page doesn't change unless I manually refresh my browser. Why is this? I use React Router v5.
Here's my code in App.js
function App() {
return (
<Router>
<div style={tempStyles}>
<Switch>
<Route exact component={Quiz} path="/quiz" />
<Route exact component={Home} path="/" />
</Switch>
</div>
</Router>
);
}
And here's my Home.js
function Home() {
return (
<Router>
<div>
<Link to="/quiz">
Take the quiz
</Link>
</div>
</Router>
);
}