I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want.
For instance, I am in localhost/aboutus and everything is fine because I arrived here pressing a link. But If I refresh the webpage i get HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
import React, { Component } from "react";
import {BrowserRouter, Route, Switch, NavLink} from 'react-router-dom';
import Home from "./Pages/Home ";
import AboutUs from "./Pages/AboutUs";
import ContactUs from "./Pages/ContactUs";
import Example from "./Pages/Login/Example";
class App extends Component {
render() {
return (
<Switch>
<Route exact path="/" exact component={Home} />
<Route exact path="/Example" component={Example} />
<Route exact path="/AboutUs" component={AboutUs} />
<Route exact path="/ContactUs" component={ContactUs} />
/>
</Switch>
<Footer />
);
}
}
export default App;