Svelte `$:` reactive statements: what the compiler actually tracks
Svelte `$:` statements re-run when the variables they read are reassigned. Here is the mechanism, a worked example, and the mistakes that break derived values.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Svelte `$:` statements re-run when the variables they read are reassigned. Here is the mechanism, a worked example, and the mistakes that break derived values.
Decide whether to use Svelte 5 runes ($state, $derived, $effect) or legacy $: statements for new components. Compare trade-offs, see a working runes-only example, and learn how to validate reactivity in mixed codebases.
UI stays stale after mutating a $state object or array in Svelte 5. A diagnostic guide for recognizing proxy reactivity loss, checking $state usage, and fixing with reassignment instead of in-place mutation.
Learn how to use Svelte’s built‑in transition system to add, customize, and optimize animations while keeping bundle size low. Includes examples, custom transitions, and accessibility tips.
A decision guide for Svelte 5 developers comparing runes, legacy stores, and component context for shared reactive state, with SSR validation steps.
Learn how to identify and fix stale UI in Svelte after data mutations, with separate steps for legacy reactive statements and Svelte 5 runes mode.
Learn how to leverage Svelte’s $: syntax to compute derived state, reduce boilerplate, and keep UI in sync. This guide walks through prerequisites, step‑by‑step usage, verification checks, and recovery options for common pitfalls.
Use $state, $derived, and $effect for component-local reactive state in Svelte 5, and keep stores for cross-component state.
Stop passing props through five layers of components. Learn how to use Svelte's writable and derived stores to manage global state efficiently and prevent memory leaks.