-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Spread Props in Component removes Reactivity #3521
Comments
This also prevents the index from updating. https://svelte.dev/repl/3d1764569a2b480ca752b7a86c5f992a?version=3.12.1 |
Update: bug still exists with <!-- will not re-render when $activeItems changes -->
<MyComp {...data} isActive={$activeItems.has(id)}/> New repro using the latest Svelte. https://svelte.dev/repl/53a3e235612d4daebbd3df318afe187d?version=3.15.0 |
@arggh Very nice. I too was going to check to see if this was incidentally fixed. |
Is this still an issue? Seem to be having the same problem. |
replace |
I am seeing a similar issue, but only when I specify a key expression in the #each. Is this the same issue, or different? See here: https://svelte.dev/repl/f68a4c8fe9e546bb9f577922415e6968?version=3.19.1 |
Describe the bug
Using the spread operator in a #each loop in variable deconstruction and use the spread props feature along side other explicit props, makes the explicit props not reactive.
Logs
See REPL
To Reproduce
https://svelte.dev/repl/3c742a2e9ab145139a64a8c344982a3e?version=3.9.2
There is a comment in the FieldSet.svelte component indicating how to remove the {...props} from being adding props to the component. Removing that will make reactivity work again.
To see it work properly, you can set this to version 3.6.7
Expected behavior
I expected to be able to use spread props along side explicit props and that everything is reactive. Note I was not able to reproduce unless the prop being spread was inside a #each and deconstructed.
Information about your Svelte project:
See REPL
Severity
This is very specific and important to the project I am working on because the spread operator is allows me to only set the variables that I want to override the defaults for. If I have to explicitly set each prop then I will end up overriding defaults that I do not want to.
The text was updated successfully, but these errors were encountered: