Svelte · Senior · Question 48 of 75
Why does SvelteKit keep page components mounted when navigating between /blog/a and /blog/b?
- ✓Correct answer: The same route component is reused and only
datachanges, so values computed once at init must be$derivedfromdata - 2It's a bug
- 3To prerender pages
Explanation
let title = data.post.title would keep the old title; let title = $derived(data.post.title) updates. {#key} would force a remount, at a cost.