Replies: 2 comments
-
It maybe todo with the original data being mutated, combined with runes. Ideally load functions should be pure - changing it to this works: const data = [{}, {}]
export function load({ params }) {
const arr = data.map(x => ({
prop: params.id,
}))
console.log(arr)
return {
arr,
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
refer to #4941, this is an expected behavior of sveltekit which isn't very well-documented, but falls inline with what you would expect of SPA apps. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't understand why my data in +page.svelte doesnt update when the one in +page.ts does.
Routing structure
[id]
-- +page.ts
-- +page.svelte
+page.ts
+page.svelte
I can see that the load function runs on param change and that the data is correctly modified. But in +page.svelte the data doesnt change. In my use case, the data used is the load function is from await parent(), but even with this minimal demo I can't get it to work. Any help is really appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions