jorgegorka / svelte-router

Svelte Router adds routing to your Svelte apps. It's designed for Single Page Applications (SPA). Includes localisation, guards and nested layouts.
MIT License
508 stars 42 forks source link

Don't recreate components #134

Open stemaDev opened 1 year ago

stemaDev commented 1 year ago

Is it possible to have the already opened routes to be maintained, so that when I go back to that route it doesn't start from the beginning but rather what I did on that route before is maintained? Instead of adding/removing the components, their visibility should be changed when navigating. Is that possible?

flipkickmedia commented 5 months ago

You should probably store this data inside the component state rather than using routes. e.g. use a context to store the state of some interaction, then when you reload the component check the context to see what state to load. Is your use case different from this approach?