File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { isFunction } from '@vue/shared'
2
- import { currentInstance } from './component'
3
- import { currentRenderingInstance } from './componentRenderContext'
2
+ import { currentInstance , getCurrentInstance } from './component'
4
3
import { currentApp } from './apiCreateApp'
5
4
import { warn } from './warning'
6
5
@@ -51,7 +50,7 @@ export function inject(
51
50
) {
52
51
// fallback to `currentRenderingInstance` so that this can be called in
53
52
// a functional component
54
- const instance = currentInstance || currentRenderingInstance
53
+ const instance = getCurrentInstance ( )
55
54
56
55
// also support looking up from app-level provides w/ `app.runWithContext()`
57
56
if ( instance || currentApp ) {
@@ -90,5 +89,5 @@ export function inject(
90
89
* user. One example is `useRoute()` in `vue-router`.
91
90
*/
92
91
export function hasInjectionContext ( ) : boolean {
93
- return ! ! ( currentInstance || currentRenderingInstance || currentApp )
92
+ return ! ! ( getCurrentInstance ( ) || currentApp )
94
93
}
You can’t perform that action at this time.
0 commit comments