S
SolidJS10mo ago
MikeM42

Route definition within a component

I can't figure out if I can add routes within a component. I've created a simple app where I have a bulma panel with tabs, and trying to route the navigation of each tab to a different component, but can't figure out how to setup the routing. This is with the latest version of solid and solid-router. I am attaching a zip with the key files here. If someone can help me figure this out I'd be appreciative. When I use this code clicking on each tab results in the Page Not Found route from App being triggered I wasnt' expecting to need to add the "Router" wrapper around the routes in the tab panel but if I don't do that I get an "Unrecognized Value" error at runtime. Note I've also tried to define the "base" for the router as "tabs" or "/tabs" or "tabs/" result is always same -> Page Not Found. I've tried using anchors in the hrefs instead of path, but that didn't help. I also have no experience using anchors with routes, so not sure how those work. I tried with routes beginning with / or ending with / like here, same thing. Can't figure it out.
1 Reply
Carl (klequis)
Carl (klequis)10mo ago
.zip files can be troublesome. Can you put an example on Stackblitz or Codesandbox?
Want results from more Discord servers?
Add your server