I have a nav bar that has Home and About links , I’m trying to make a router that goes to About page when I click on about link and goes to home when I click on Home link , but I don’t know why either I click at home or about , It takes me to Home page
this is App.js file :
<Router>
<Box>
<Navbar />
<Home />
<Routes>
<Route exact path="/" component={Home}/>
<Route path="/about" component={AboutUs}/>
</Routes>
</Box>
</Router>
and this is Home.js file :
function Home() {
return (
<div>
<FirstSection />
<SecondSection />
<ThirdSection />
</div>
)
}
and this is About file :
function AboutUs() {
return (
<div>AboutUs</div>
)
}
and lastly this is the nav bar :
<a href="/">
<MenuButton>
Home
</MenuButton>
</a>
</Menu>
<Menu>
<a href="/about">
<MenuButton>
About us
</MenuButton>
</a>