-
-
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
Default properties in parent component default to "undefined" when omitted with spread #3063
Comments
Is this a bug? This behavior makes sense to me since the code inside the script block is only executed once. You could use the |
I see. I may have misiterpreted how things work here. Is there a simple way to force a nested component to recreate ? |
That's expected vanilla JS behaviour. Either you use |
The combination of |
Simple demo here : https://svelte.dev/repl/d0476b3598e648cfbe38922617a8798c?version=3.5.3
Basically, if you have an object that is used as spread props for a child component, and you overwrite the variable with a new object with different keys, the keys that were present and are missing takes precedence as undefined over the child component default values.
The text was updated successfully, but these errors were encountered: