-
A In the orginal Stats.svelte component:
I replaced reactive declarations ($:) with state runes ($state) for reactive variables. Reactivity with Runes component:
Svelte 5's runes system change breaks the page. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Did the migration tool create this code or you? These two are not the same: // Will always keep `darkMode` in sync with `darkModeStore`
$: darkMode = $darkModeStore;
// Defines a reactive state with _initial_ value of `$darkModeStore`
let darkMode = $state($darkModeStore); You need to use https://svelte.dev/playground/7383f7af2c8e45868c34edf8fbbbcb4c?version=5.10.0 |
Beta Was this translation helpful? Give feedback.
Did the migration tool create this code or you?
These two are not the same:
You need to use
$derived
everywhere, because you are deriving state from a store.https://svelte.dev/playground/7383f7af2c8e45868c34edf8fbbbcb4c?version=5.10.0