jorgegorka/svelte-router

Don't recreate components

Opened this issue · 1 comments

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?

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?