Skip to content

Svelte 5: afterUpdate only tracks props that are being used in the template #9420

@paoloricciuti

Description

@paoloricciuti

Describe the bug

afterUpdate should run every time a component has been updated but currently it only runs if the prop that changes is actually been used in the template.

Reproduction

  • go to this repl
  • update count with the first button
  • observe that the console logs "after update"
  • update count2 with the second button
  • observer that nothing shows up in the console

for reference this is svelte 4 behavior Svelte 4 REPL

Logs

No response

System Info

Svelte REPL

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