S
SolidJS5mo ago
Don

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
No description
4 Replies
peerreynders
peerreynders5mo ago
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/1234150263875567647
GitHub
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.
Don
Don5mo ago
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
peerreynders
peerreynders5mo ago
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.
Don
Don5mo ago
I made it work like this with (main).tsx (main) folder
No description
Want results from more Discord servers?
Add your server