Home > Software design >  React Router v6 Nested Routes doesn't work
React Router v6 Nested Routes doesn't work

Time:04-04

I want to render subroute with nested routes .

Expected results -> /bilgi/detay

I've tried like this but it doesn't return any page ..

<Routes>
        <Route path="/" exact element={<Home />} />
        <Route path="bilgi"  element={<Information />} >
           <Route path='detay'  element={<Contact/>}/>
        </Route>
</Routes>

CodePudding user response:

It didn't work for me either :)

CodePudding user response:

You can do like

<Routes>
    <Route path="/" exact element={<Home />} />
    <Route path="/bilgi" exact element={<Information />} />
    <Route path='/bilgi/detay' exact element={<Contact/>}/>
</Routes>
  • Related