Closed developer239 closed 7 years ago
Hey @developer239! You can see an example in the react router docs. You're looking for the child routes.
From the example
const routes = {
path: '/',
component: App,
indexRoute: { component: Dashboard },
childRoutes: [
{ path: 'about', component: About },
{
path: 'inbox',
component: Inbox,
childRoutes: [{
path: 'messages/:id',
onEnter: ({ params }, replace) => replace(`/messages/${params.id}`)
}]
},
{
component: Inbox,
childRoutes: [{
path: 'messages/:id', component: Message
}]
}
]
}
render(<Router routes={routes} />, document.body)
Please let me know if you have any further questions @developer239
How do you define nested routes when you don't use jsx?