Skip to content

Inconsistent compilation of value when using context #15880

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

You must be logged in to vote

This isn't about context, this is because Svelte compiled your code in legacy mode in the first example. Currently, Svelte will default to compiling your code in legacy mode if it doesn't see any Svelte 5 features being used (eg runes). In legacy mode, all top level variables that are reassigned are implicitly reactive, which is why data was reactive in the first example.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cycsd
Comment options

Answer selected by cycsd
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