Skip to content

Commit 76f54fd

Browse files
committed
chore: revert runtime
1 parent 85cc8f0 commit 76f54fd

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

packages/runtime-vapor/src/component.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,21 +1027,14 @@ function handleSetupResult(
10271027
devRender(instance)
10281028
}
10291029
} else {
1030-
if (component.render) {
1031-
if (!isBlock(setupResult)) instance.setupState = setupResult
1032-
instance.block =
1033-
callWithErrorHandling(
1034-
component.render,
1035-
instance,
1036-
ErrorCodes.RENDER_FUNCTION,
1037-
[
1038-
instance.setupState,
1039-
instance.props,
1040-
instance.emit,
1041-
instance.attrs,
1042-
instance.slots,
1043-
],
1044-
) || []
1030+
// component has a render function but no setup function
1031+
// (typically components with only a template and no state)
1032+
if (setupResult === EMPTY_OBJ && component.render) {
1033+
instance.block = callWithErrorHandling(
1034+
component.render,
1035+
instance,
1036+
ErrorCodes.RENDER_FUNCTION,
1037+
)
10451038
} else {
10461039
// in prod result can only be block
10471040
instance.block = setupResult as Block

0 commit comments

Comments
 (0)