I have a very simple page app, the index route does not work on it.
import { Routes, Route, Outlet } from 'react-router-dom';
import Home from './routes/home/home.component.jsx'
import Heading from './components/Heading';
function Header () {
return (
<>
<Heading />
<Outlet />
</>
)
}
function App() {
return (
<Routes>
<Route path='/' element={<Header />} >
<Route index path='home' element={<Home />} />
</Route>
</Routes>
);
}
export default App;
This is what gets shown on default, only the navbar with no home index element:
My question is why is that happening and how to fix this when my code is basically non existent and I can't see where I made the mistake
Thanks!