-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
"x was created without expected prop y" false alert with binding when prop = undefined #4457
Comments
I think this is not a bug, as |
Same here. This is very annoying to see warnings like these (and these). |
I had this code
And got these warnings
Changing it to
silenced the warnings. |
@paulschreiber it's not ideal because now your code is suggesting that |
@oatymart what's the proper way to solve this? |
Use the appropriate default according to type for each of your props that deserves one, or continue to omit it if that makes more sense. Just don't expect to achieve perfection because it's all a tradeoff between warnings, readability, and convenience. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm having this issue popup as well |
This should be fixed in 3.51.0 - https://svelte.dev/repl/65985a2e42fe4b899a379750fe609447?version=3.51.0 |
Didn't have this warning before, and a lot of my components intentionally have many optional props. How do we remove this clutter from the console ? |
I am having this issue today. Setting default values is not working either. |
Apologies, I had a component using an imported svelte component from node modules that I mistook the error as coming from my own "wrapper" component. |
Hacky solution to suppress all of these: +layout.js
|
https://svelte.dev/repl/65985a2e42fe4b899a379750fe609447?version=3.19.1
<Component> was created without expected prop 'value'
a fix for this would involve replacing a ton of test results so I'd suggest addressing #4454 at the same time
The text was updated successfully, but these errors were encountered: