Skip to content

Svelte 5: Class fields aren't reactive #11590

@rootext

Description

@rootext

Describe the bug

Class fields of objects wrapped with $state() rune aren't reactive in Svelte 5.
For instance, replacing let node = new Node('root') with let node = $state(new Node('root')) breaks reactivity for fields in Node class.

Reproduction

Logs

no logs

System Info

any browser

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions