export activeRoute from Router Componenet

This issue has been tracked since 2020-12-02.

Hello, I would like to ask why is activeRoute is not exported by default in the Router.svelte component, that way users will be able to bind into that store, when the SPA is mounted (using onMount to subscribe to the store), therefore being able to determine the active route at the App.svelte level ( assuming one router) or at whichever file they use the Router.svelte for nested routes

mefechoel wrote this answer on 2020-12-15

My guess is, that it is just intended to be used internally, so @EmilTholin does not have to make any guaranties about its structure. You can probably get most of the information you need by accessing the current location of the Router via the Route components. That way the API surface is a lot cleaner and easier to maintain.

EmilTholin wrote this answer on 2020-12-31

Hi @OmG3r!

@mefechoel is correct; it's not part of the public API, so it's not exported. There is a temporary workaround outlined in this issue, but that was also not a intended API, so we will have to figure out a fitting solution to this.

More Details About Repo
Owner Name EmilTholin
Repo Name svelte-routing
Full Name EmilTholin/svelte-routing
Language JavaScript
Created Date 2017-11-28
Updated Date 2022-12-03
Star Count 1711
Watcher Count 21
Fork Count 151
Issue Count 59

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date