Skip to content

Commit 9b5e134

Browse files
committed
refactor: replace getCurrentInstance with getCurrentGenericInstance in useHost function
1 parent cf93845 commit 9b5e134

File tree

3 files changed

+418
-400
lines changed

3 files changed

+418
-400
lines changed

packages/runtime-core/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ export {
105105
// plugins
106106
export { getCurrentInstance } from './component'
107107

108+
/**
109+
* @internal
110+
*/
111+
export { getCurrentGenericInstance } from './component'
112+
108113
// For raw render function users
109114
export { h } from './h'
110115
// Advanced render function utilities

packages/runtime-dom/src/apiCustomElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
type VNodeProps,
2828
createVNode,
2929
defineComponent,
30-
getCurrentInstance,
30+
getCurrentGenericInstance,
3131
nextTick,
3232
unref,
3333
warn,
@@ -793,7 +793,7 @@ export class VueElement extends VueElementBase<
793793
}
794794

795795
export function useHost(caller?: string): VueElementBase | null {
796-
const instance = getCurrentInstance()
796+
const instance = getCurrentGenericInstance()
797797
const el = instance && (instance.ce as VueElementBase)
798798
if (el) {
799799
return el

0 commit comments

Comments
 (0)