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

provide() overrides inject() with same key in the current instance if it appears early. #2400

Closed
07akioni opened this issue Oct 17, 2020 · 2 comments · Fixed by #2424
Closed

Comments

@07akioni
Copy link
Contributor

Version

3.0.1

Reproduction link

https://codesandbox.io/s/vue-provide-bug-i8iq9?file=/src/App.js

Steps to reproduce

follow the link

What is expected?

A Provide => A

What is actually happening?

A Provide

@07akioni
Copy link
Contributor Author

Although it works if I put provide after inject, I think it shouldn't work in this way.

@69hunter
Copy link
Contributor

I think for the provide/inject API, the component should not be able to self-inject it's own provide, regardless of the order of provide and inject in the setup function. As previously mentioned in #1818.

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

Successfully merging a pull request may close this issue.

2 participants