Skip to content

Reactivity lost in derived that returns state created outside of derived under certain circumstances #15180

Closed
@Leonidaz

Description

@Leonidaz

Describe the bug

Derived's reactivity seems to be lost if it returns a state created outside of the derived. This happens only if the derived's returned state is mutated in the component instance block (inside <script>).

Reproduction

Reproduction playground

Steps to replicate:

  • click on increment linked button
  • click on increment count button
  • click on increment linked button
  • the reactivity is lost as linked count should have been incremented

removing linked.current++; on line 14 in the <script></script> fixes it

Logs

n/a

System Info

playground

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