We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d762a8 commit 9417340Copy full SHA for 9417340
packages/runtime-core/src/apiInject.ts
@@ -1,6 +1,5 @@
1
import { isFunction } from '@vue/shared'
2
-import { currentInstance } from './component'
3
-import { currentRenderingInstance } from './componentRenderUtils'
+import { currentInstance, getCurrentInstance } from './component'
4
import { warn } from './warning'
5
6
export interface InjectionKey<T> extends Symbol {}
@@ -45,7 +44,7 @@ export function inject(
45
44
) {
46
// fallback to `currentRenderingInstance` so that this can be called in
47
// a functional component
48
- const instance = currentInstance || currentRenderingInstance
+ const instance = getCurrentInstance()
49
if (instance) {
50
// #2400
51
// to support `app.use` plugins,
0 commit comments