SolidJSS
SolidJSโ€ข14mo agoโ€ข
5 replies
oCarrott

Multiple layouts using `Router`

Hi, I cant figure out how to do nested layouts like this

 <SidebarProvider>
       <SiderBar />
       <Router> 
        <Router> 
         {routes.map((route) => (
           <Route path={route.path} component={route.component} />
         ))}
       </Router>
       </Router>
        <Router root={DashboardLayout}>
          <Route path={routes[4].path} component={routes[4].component} />
        </Router>
      </SidebarProvider>


The issue with this setup is that I get an error from root={DashboardLayout} and I see the 404 page an the , probably because Router is used twice
I don't know how to implement this without using Router twice, and how to prevent the error
Was this page helpful?