Skip to content

Passing SvelteMap (SvelteSet) from +page.server.ts makes it a normal Map (Set)? #15060

Answered by Ocean-OS
T1xx1 asked this question in Q&A
Discussion options

You must be logged in to vote

This question is probably more relevant in the SvelteKit repo, but SvelteKit uses devalue to serialize server-side loaded props, and SvelteMaps and SvelteSets are probably coerced to their nonreactive counterparts during serialization. TypeScript probably has no idea that this happens, so it incorrectly infers the types. Read here for more info.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by T1xx1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants