Skip to content
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

Prop value doesn't stay default if it gets undefined #3251

Closed
elite174 opened this issue Jul 16, 2019 · 1 comment
Closed

Prop value doesn't stay default if it gets undefined #3251

elite174 opened this issue Jul 16, 2019 · 1 comment

Comments

@elite174
Copy link

https://svelte.dev/repl/d8c112a251984339b564f0506365e32f?version=3.6.7

It seems like default prop value is used only once (after the mounting), and it doesn't work after that.

@antony
Copy link
Member

antony commented Dec 24, 2019

This appears to work exactly as intended.

I think you are mistake the initial value of a prop for the "default" value of a prop. This isn't the case, it's just an initial value. If you set the value to undefined, it doesn't default back to it's initial value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants