Closed jamauro closed 4 years ago
You can use reactive statement:
$: params = router.params($router)
See example here - https://svelte.dev/repl/c711f397d4924ccda79224e8a3ee0ada?version=3.24.1
Maybe better way which will be use stores will be implemented in future versions.
When navigating between routes that have the same shape, e.g.
/things/:id
, it doesn't appear thatrouter.params()
is updated. Is there a way to make it reactive?If I go back to
/things
and navigate to another/things/:id
, it works as expected. If I pass in the param using thelet:params
, theparams.id
is updated as expected.