Skip to content

Spread Props in Component removes Reactivity #3521

Closed
@dbowmanDT

Description

@dbowmanDT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions