Closed natembennett closed 2 years ago
It’s definitely a scenario that should work.
are you able to provide more info? What browser are you using? Can you perhaps share some code to reproduce this as MVP?
Maybe this one could help you.
https://github.com/ItalyPaleAle/svelte-spa-router/issues/14
I had the same issue and finally had a look in the closed ones.
To solve this you can force re-render the component inside of a parent component when the params change.
<script>
import SomeComponent from "SomeComponent.svelte"
export let params
</script>
{#key params.someParam}
<SomeComponent someParam={params.someParam} /> // All code from the route moved into this component
{/key}
The solution proposed by @MerlinB is the correct one :) Going to close this as it is behaving by design
Try replacing your a tag with button and use the push method. Worked for me! (even with animation)
If I have a route such as:
'blog/:id: Blog'
and I navigate to blog/3, via a link/href from blog/2, the route doesn't update. I have tried using traditional links as well as the imperativepush
andreplace
functions provided by this library.