We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using provide/inject as component store and want to provide some value if it is not already provided by parent component, e.g.:
let v = inject(key) if (!v) { provide(key, value) }
It works well except that on first invocation there is a warning that injection not found.
Remove the warning or provide some way to silence it or "declare" injection value without overriding existing one, e.g.:
inject(key, undefined) // undefined means set value if it does not already exist
The text was updated successfully, but these errors were encountered:
fix(inject): allow default value to be undefined
undefined
01b61ab
Close #892
fix(inject): allow default value to be undefined (#894)
94562da
"export 'inject' was not found in 'vue'
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What problem does this feature solve?
I am using provide/inject as component store and want to provide some value if it is not already provided by parent component, e.g.:
It works well except that on first invocation there is a warning that injection not found.
What does the proposed API look like?
Remove the warning or provide some way to silence it or "declare" injection value without overriding existing one, e.g.:
The text was updated successfully, but these errors were encountered: