prefetching based on route params always return same result
In sveltekit project, I want to fetch dynamic data on route change.
in page.ts
in svelte component file
when mounting on
/draft/1 page, the target draft(id: 1) correctly fetched.
but navigating to /draft/2 page, $getDraftByIdQuery.data is not updated contrary to my expectation.
i checked parameter(draftId) in query keys matching each other when route changing happen.
sorry for my bad english. appreciate any help.1 Reply
optimistic-goldOP•3y ago
oh i just made silly mistake, problem is reactivity for route params
change to: