This commit is contained in:
zhiyuanzmj 2025-06-26 16:10:58 +08:00 committed by GitHub
commit 957f2b8615
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -150,8 +150,9 @@ export function createComponent(
resetInsertionState()
}
const isFnComponent = isFunction(component)
// vdom interop enabled and component is not an explicit vapor component
if (appContext.vapor && !component.__vapor) {
if (appContext.vapor && !isFnComponent && !component.__vapor) {
const frag = appContext.vapor.vdomMount(
component as any,
rawProps,
@ -205,7 +206,7 @@ export function createComponent(
setupPropsValidation(instance)
}
const setupFn = isFunction(component) ? component : component.setup
const setupFn = isFnComponent ? component : component.setup
const setupResult = setupFn
? callWithErrorHandling(setupFn, instance, ErrorCodes.SETUP_FUNCTION, [
instance.props,
@ -214,7 +215,7 @@ export function createComponent(
: EMPTY_OBJ
if (__DEV__ && !isBlock(setupResult)) {
if (isFunction(component)) {
if (isFnComponent) {
warn(`Functional vapor component must return a block directly.`)
instance.block = []
} else if (!component.render) {