Skip to content

Commit 9417340

Browse files
committed
chore(runtime-core): use getCurrentInstance
chore: clean chore: clean
1 parent 6d762a8 commit 9417340

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/runtime-core/src/apiInject.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { isFunction } from '@vue/shared'
2-
import { currentInstance } from './component'
3-
import { currentRenderingInstance } from './componentRenderUtils'
2+
import { currentInstance, getCurrentInstance } from './component'
43
import { warn } from './warning'
54

65
export interface InjectionKey<T> extends Symbol {}
@@ -45,7 +44,7 @@ export function inject(
4544
) {
4645
// fallback to `currentRenderingInstance` so that this can be called in
4746
// a functional component
48-
const instance = currentInstance || currentRenderingInstance
47+
const instance = getCurrentInstance()
4948
if (instance) {
5049
// #2400
5150
// to support `app.use` plugins,

0 commit comments

Comments
 (0)