the page doesn't re-render when router params changes #10942
-
Describe the bugAssume we have a route ReproductionRepo: https://github.com/anuragkumar19/sveltekit-issue LogsNo response System InfoI use github codespaces
System:
OS: Linux 6.2 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (2) x64 AMD EPYC 7763 64-Core Processor
Memory: 5.45 GB / 7.74 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 20.8.1 - ~/nvm/current/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 10.1.0 - ~/nvm/current/bin/npm
pnpm: 8.9.2 - ~/nvm/current/bin/pnpm
npmPackages:
@sveltejs/adapter-auto: ^2.0.0 => 2.1.0
@sveltejs/kit: ^1.20.4 => 1.27.1
svelte: ^4.0.5 => 4.2.2
vite: ^4.4.2 => 4.5.0 Severityannoyance Additional InformationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
https://kit.svelte.dev/docs/state-management#component-state-is-preserved |
Beta Was this translation helpful? Give feedback.
-
I have tried the |
Beta Was this translation helpful? Give feedback.
-
I have tried |
Beta Was this translation helpful? Give feedback.
-
What I wanted is a local state |
Beta Was this translation helpful? Give feedback.
The workaround I found is similar to that you suggest.
It uses svelte store and update the title when data changes. I use svelte store because this will not work as it define new calculated value title.