Subscribe on changes!

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

avatar
Oct 17th 2020

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

avatar
Oct 17th 2020

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

avatar
Oct 18th 2020

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 https://github.com/vuejs/vue-next/issues/1818.