Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/runtime-core/src/apiInject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isFunction } from '@vue/shared'
import { currentInstance } from './component'
import { currentRenderingInstance } from './componentRenderContext'
import { currentInstance, getCurrentInstance } from './component'
import { warn } from './warning'

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