You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently Kit's router does not give access to location state and always pushes an empty object. It's only used internally to restore scroll position.
It seems that the router should not abstract away this feature, as it can be useful for many different cases (animation restoration, saving some screen state, passing state between routes, etc.).
Describe the solution you'd like
I would say, the API surface consists of 3 parts:
pass state object in goto in the second argument
allow for passing state in the <a> tag in some property, like sveltekit:state={}
adding a new readable store in $app/stores that updates the value as you go back and forth the history and excludes internal properties along the way
Describe alternatives you've considered
n/a
How important is this feature to you?
I wouldn't say this feature is a deal-breaker, but I also think Kit shouldn't abstract away basic browser features.
Additional context
My only concern is that it doesn't play nice with SSR and with TypeScript. Other than that it can be the only elegant solution sometimes.
The text was updated successfully, but these errors were encountered:
There was a PR for this in Sapper: sveltejs/sapper#1341. Unfortunately, we didn't get a chance to get it merged before switching development over to SvelteKit
Is your feature request related to a problem? Please describe.
Currently Kit's router does not give access to location state and always pushes an empty object. It's only used internally to restore scroll position.
It seems that the router should not abstract away this feature, as it can be useful for many different cases (animation restoration, saving some screen state, passing state between routes, etc.).
Describe the solution you'd like
I would say, the API surface consists of 3 parts:
goto
in the second argument<a>
tag in some property, likesveltekit:state={}
$app/stores
that updates the value as you go back and forth the history and excludes internal properties along the wayDescribe alternatives you've considered
n/a
How important is this feature to you?
I wouldn't say this feature is a deal-breaker, but I also think Kit shouldn't abstract away basic browser features.
Additional context
My only concern is that it doesn't play nice with SSR and with TypeScript. Other than that it can be the only elegant solution sometimes.
The text was updated successfully, but these errors were encountered: