Basil
Basil

Reputation: 588

Default Route for Svelte-Navigator?

I'm using svelte-navigator to handle routing in my Svelte application, and I have the issue that when accessing a route that I have not defined, it still loads the header and sidebar etc (which are outside the routes) - Is there a way to set a default route, so that when accessing an undefined route, it can redirect to the home page etc?

Upvotes: 1

Views: 1270

Answers (1)

Stephane Vanraes
Stephane Vanraes

Reputation: 16451

From the documentation

<!--
  Routes without a path are default routes.
  They will match if no other Route could be matched
-->
<Route component="{Home}"></Route>

Upvotes: 3

Related Questions