-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(runtime-core): fix inject with currentApp #11604
Conversation
Size ReportBundles
Usages
|
Good job! But I think this won't fix the issue since it's not something really wrong with Vue itself. Please take a look at my comment here for more details: link. |
|
||
if (currentApp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should move this code above const provides = instance
@Gianthard-cyh Misunderstood. |
Yes, I think this PR is actually doing this: fall back to the component's provides if there is a currentApp but key is not found in its provides. Also, this will affect the behavior of pinia when injecting a property provided by a component. The I think this needs to be further discussed: should |
@Gianthard-cyh Thank you for your review, but I don’t know how to cancel the associated issue. |
It should not fallback because that would make the behavior of Pinia stores indeterministic. |
What is expected?
expect(childApp.runWithContext(() => inject('bar'))).toBe('bar')
What is actually happening?