S
SolidJS•2y ago
Max

Explicit Routing (opt out of file based)

Hi, wondering what the options for routing in solid-start are? I've seen around (for example https://start.solidjs.com/api/Outlet#rendering-the-matched-child-route-component-inside-a-layout-route-component) you can have a routes files, is this complimentary to file based routing, should they match somehow? Can routes be explicitly set (route=>component)? For some context, say for example I have many files that each export a Record of string and component, then I would like to create a route for each member of this record from each file Thanks
SolidStart Beta Docuentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
3 Replies
jesseb34r
jesseb34r•2y ago
if you want to opt out of file-based routing, don't use the fileroutes component and define routes using solid-router like normal. You do lose some of the start-specific functionality like routeData though. you can do layout routes with file routing though so if that's all you're looking for you don't need to opt out I believe the example is showing what the generated routes file would look like if you were using the filerouting naming scheme?
Max
Max•2y ago
nice one! thanks for explaining that🔥
jesseb34r
jesseb34r•2y ago
of course!
Want results from more Discord servers?
Add your server