I was wondering if there is a way to nest routes in react in that Navbar is to become the parent component of dashboard and properties
<Router>
<Routes>
<Route path='/' element={<Home />} />
<Route path='/login' element={<Login />} />
<Route path='/signup' element={<Signup />} />
<div>
<Navbar />
<div>
<Route path='/dashboard' element={<Dashboard />} />
<Route path='/properties' element={<Dashboard />} />
</div>
</div>
</Routes>
</Router>
Just like you would do in Vue router
const routes = [
{
path: '/user/:id',
component: User,
children: [
{
// UserProfile will be rendered inside User's <router-view>
// when /user/:id/profile is matched
path: 'profile',
component: UserProfile,
},
{
// UserPosts will be rendered inside User's <router-view>
// when /user/:id/posts is matched
path: 'posts',
component: UserPosts,
},
],
},
]