-
Notifications
You must be signed in to change notification settings - Fork 380
Cannot use @Provide and @ProvideReactive simultaneously #249
Comments
Was going to report this, and saw that someone beat me to it... |
See PR #264 |
Fix Provide/ProvideReactive compatibility (#249)
This PR actually completely broke the ProvideReactive/InjectReactive feature. Before, it would at least work if you declared your reactive injections before the non-reactive ones. Now, any reactive injection produces the error: |
See PR #281 for a proposed fix. |
@gmoneh Well it worked for us (??), and I must admit I did not have the time to think it further once I solved what was blocking us. But yea, i'm quite not suprised that some problems remained. It seemd to be too much of a quick copy paste from the non reactive version to work properly. And to be honest, I ended up implementing our own injection attributes for other reasons. So i'm sorry if this PR broke something. |
Issue #249: Fixed issue on provider producer function when reusing with different…
I can run them expectly by seperately, but if I conbine them together, like
then, the children of class Parent can only get @provide properties. it will report an error if any child reference age, like
@InjectReactive() private age!: number
, the error message is[Vue warn]: Injection "__reactiveInject__" not found
.I explored your source code and found that your Provide method and ProvideReactive method definitions both use same judgement(line 54-55 && line 76-77)
so , if use any one of them , the else will never has opportunity to change this componentOptions's provide property, which cause my problem.
There is some ways to walk around, use @ProvideReactive firstly, or use in seperately in deffrents components. I'm note sure this is designed on purpose or what , whick make me some inconvenient.
The text was updated successfully, but these errors were encountered: