Solid Start (experiments) nested layout
In Solid-Start (experiments), it's possible to have nested layouts like this, which work fine. But what about a nested layout at the root of the project? I tried index.tsx and an index folder, or (main).tsx and a main folder, but none of them sadly worked.
![No description](https://cdn.answeroverflow.com/1235643426444283934/image.png)
![No description](https://cdn.answeroverflow.com/1235643426964504657/image_1.png)
4 Replies
But what about a nested layout at the root of the project?It's entirely possible that I'm misunderstanding something but the root component is the page layout that all other routes are nested into. There is nothing stopping you from factoring it out into it's own
tsx
file.
FYI: https://discord.com/channels/722131463138705510/1234062681455988736/1234150263875567647GitHub
solid-start/examples/basic/src/app.tsx at ae8f2d784c60b20170c55f53d...
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
yes I think you misunderstood what I said I am talking about something similiar to layout.tsx in nextjs where you can group a routes via prop.children
Are you talking about Route Groups (Next)?
The biggest difference I see with a nested layout
is that if you have a
/dashboard
route, the layout in Next is defined as
app/dashboard/layout.tsx
while in Start it would be
routes/dashboard.tsx
(provided there is a routes/dashboard/index.tsx
or equivalent)
The equivalent for Next's app/layout.tsx
in Start is the root
component in app.tsx
.SolidStart Release Candidate Documentation
SolidStart Release Candidate Documentation
Early release documentation and resources for SolidStart Release Candidate
Routing: Layouts and Templates | Next.js
Create your first shared layout in Next.js.
I made it work like this with (main).tsx (main) folder
![No description](https://cdn.answeroverflow.com/1235919353967542282/image.png)