Skip to content

derived does not update dom #15233

@alex-pirogov

Description

@alex-pirogov

Describe the bug

I've made this simple repl where result is constructed from initial and dynamic variables using $derived rune. By clicking the first button dynamic changes and thus result is also expected to be changed, which it seems to be according to console logs. But dom is not changed until the second button is clicked, explicitly toggling {#key ...} around target dom.

I am not shure if this is expected behavior or not. If it is i wonder if there is a way to update dom without {#key ...} directive.

Reproduction

https://svelte.dev/playground/08c395888df14b178b71f0d60dc77898?version=5.19.8

Logs

System Info

Svelte v5.19.8 REPL

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