Skip to content

State destruction depends on other state? #15299

@mblandr

Description

@mblandr

Describe the bug

State destruction depends on other state?

Reproduction

https://svelte.dev/playground/8927c1b4ff6e4905a459fb4045fecdeb?version=5.20.0
When I destruct value from state_from_file, it's not reactive, as I guess, it should be - desctiruct primitive value not from $state rune)
BUT! When I comment this line:
let state_temp = $state({ vvv: 1 });

value became reactive???
May be I am wrong, but this behavior (value in this case) shouldn't depends on other definition in file (state_from_file in this case)?

Logs

System Info

svelte 5

Severity

annoyance

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