Skip to content

Dynamic props in svelte:component are not properly updated #9003

Closed
@fbasso

Description

@fbasso

Describe the bug

Hello !

There is a regression between the 4.0.5 and the 4.1.0.

When using the following code:

<svelte:component this={component} {...props} />

The props are not re-evaluated properly. See the REPLs

It's maybe related to #8946 (?)

Reproduction

When you click on the Switch component button, the component value must be updated accordingly.

Fails: https://svelte.dev/repl/ff06036a1ebe42ae8fdd017f99648621?version=4.1.0

Pass: https://svelte.dev/repl/ff06036a1ebe42ae8fdd017f99648621?version=4.0.5

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-1370P
    Memory: 20.71 GB / 31.66 GB
  Binaries:
    Node: 20.4.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.6.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.9 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.82)
    Internet Explorer: 11.0.19041.1566

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompilerChanges relating to the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions