import './App.css';
import PrimaryNavbar from './components/PrimaryNavbar';
import SecondaryNavbar from './components/SecondaryNavbar';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Logo from './components/Logo';
import MobileNavbar from './components/MobileNavbar';
import Home from './components/Contents/Home'
import Deals from './components/Contents/Deals';
import Goto from './components/Contents/Goto';
import SignUp from './components/Contents/SignUp';
import Todo from './components/Contents/Todo';
import Cards from './components/Cards';
function App() {
return (
<>
<Router>
<div className="d-flex justify-content-around">
<PrimaryNavbar />
<Logo />
<SecondaryNavbar />
<MobileNavbar />
</div>
<Home />
<Cards />
<Routes>
<Route path="/" exact component={<Home />} />
<Route path="/deals" component={<Deals />} />
<Route path="/goto" component={<Goto />} />
<Route path="/todo" component={<Todo />} />
<Route path="/signup" component={<SignUp />} />
</Routes>
</Router>
</>
);
}
export default App;
I tried every possible way to link to a new page but failed. I tried using switch(v5) too. When I tried
<Route path="/" exact element={<Home />} > </Route>
I was able to get the content from my other pages, but they all got at the bottom. Every time, I switch to the new page the content comes at the bottom with the above code. But with the first code, I don't even get the content from other pages, the links changes without giving any content.