There are several implementations of router for Svelte framework, but a lot of them are not updated, or the functionality is weird.
Why not to include this basic feature to the framework?
I found duplicate issues, so I'll close this. Sorry :)
(To be maximally helpful to any future person who lands on this page... how about linking to the most relevant routing-related issues?)
FWIW, it doesn't seem likely that there will ever be a router built into the core of Svelte, which is a component library and not an application framework.
It's slightly more likely but also still I think not particularly likely that an official separate library will be published for routing. I've added a paragraph talking about Sapper to the 'what about routing' question on the FAQ. Sapper is probably as close to an official router as there's going to be. It's hard for something that's just a router to also be able to handle all of the other things like server-side rendering and rehydration that Sapper is able to handle.
The main issue where this was discussed previously was #172, which I also closed recently, because Sapper's is the only routing solution that Svelte is currently interested in blessing.
Would be great to have something like React-Router for Svelte...
I'm really trying to use it, but all routers are complex to implement Nested Routes....
something like
App.svelte
<Router>
<Route path="/users" component={Users}/>
</Router>
and
Users.svelte
<Router>
<Route path="/" exact component={Index}/>
<Route path="/:id" exact component={Show}/>
<Route path="/:id/edit" component={Edit}/>
</Router>
would be GREAT...
You might want to try this: https://github.com/EmilTholin/svelte-routing
You might want to try this: https://github.com/EmilTholin/svelte-routing
It works, thanks.
@bigjoevtrj on my side - working on component-based router to cover common cases (like leaving the page protection) as possible. https://github.com/qutran/swheel
Most helpful comment
You might want to try this: https://github.com/EmilTholin/svelte-routing