This is my app.js:
import React from 'react';
import './App.css';
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import { Navbar } from './components/Navbar';
import Home from './pages/Home.js'
import SignUp from './pages/SignUp.js'
import SignIn from './pages/SignIn.js'
function App() {
return (
<>
<Router>
<Navbar />
<Switch>
<Route path="/" exact component={Home} />
<Route path="/signup" exact component={SignUp} />
<Route path="/signin" exact component={SignIn} />
</Switch>
</Router>
</>
);
}
export default App;
When I’m using Link-to, it is changing the URL, but isn’t updating the content of the website, unless I reload the page. I am using router v5.2.0. Please help!