Routes and FileRoutes

Hello! I'm new to Solid and I had some questions about Routes. I followed what was written in solidStart, but I still have some questions about FileRoutes. For example, is it possible to create a custom Layer for some pages and still using FileRoutes ? For example, with a tree like that
routes
├── [...404].tsx
├── index.tsx
└── test.tsx
routes
├── [...404].tsx
├── index.tsx
└── test.tsx
For example, I would like for index.tsx and test.tsx to both have a <Header/> that would be defined in ~/components I know that this is possible with Routes, but I was wondering if it was with FileRoutes
6 Replies
jesseb34r
jesseb34r2y ago
Shared layouts are pretty easy to do with route groups and the ‘<Outlet />’ component. I talked about this more here https://discord.com/channels/722131463138705510/1057754962110730381/1057782711919579326
tkirishima
tkirishimaOP2y ago
Thanks :) Helped me! But from what I understood, it doesn't totally respond to my problem. For example, if I have 6 files a.tsx, b.tsx, c.tsx, d.tsx, e.tsx, f.tsx and that I would like to have a specific header for a,b,c and another one for d, e, f would it be possible ? (And a,b,c,d,e,f are in the same folder)
jesseb34r
jesseb34r2y ago
put them in different groups. so like, make different folders for them
tkirishima
tkirishimaOP2y ago
But if I create different folder for them, the URL to access them is also going to change, no ?
jesseb34r
jesseb34r2y ago
that's what a route group does for you. categorization without changing urls
jesseb34r
jesseb34r2y ago
SolidStart Beta Docuentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
Want results from more Discord servers?
Add your server