-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Regression: svelte:component with spread props loses static props #9177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I confirm similar strange behaviour on 4.2.0. I would classify it as a quite major bug. REPL: https://svelte.dev/repl/1136dab3b7d642b7a429974c881057ae?version=4.2.0 (somewhat similar to above) TL;DR: the two lines below behave differently // doesn't work
<svelte:component this={component} {...props} {foo} />
// works
<svelte:component this={component} {...{...props, foo}} /> |
For your interest this works fine on the Svelte v5 Preview REPL. |
I also faced the same problem. Svelte version 4.2.8 |
Any update here? It's critical bug. Any dynamic forms are broken |
Apply a fix, but the bug is due to: sveltejs/svelte#9177
Fixed in Svelte 5 |
Describe the bug
It looks like #9006 introduced a bug.
When changing
this
and a spread props object, static props are not passed to the new component.Also, it seems like the old spread props are passed to the new component first and then get changed to the new spread props.
Reproduction
https://svelte.dev/repl/c967016570194f1e90a1226132377e61?version=4.1.1
When clicking "page1" or "page2", it always should log
"toto"
, insteadundefined
and"<Page2> was created without expected prop 'test'"
is logged.Also
"<Page2> was created with unknown prop 'page1Prop'"
is logged, which indicates the old spread props are passed to the new component.REPL is working on version 4.1.0: https://svelte.dev/repl/c967016570194f1e90a1226132377e61?version=4.1.0
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: