From 37836c57966eb35314527ccaec6a7c2c80399d33 Mon Sep 17 00:00:00 2001 From: Alex Snezhko Date: Sat, 28 Jun 2025 20:44:39 -0700 Subject: [PATCH] fix(runtime-core): always pass context arg to functional components --- .../runtime-core/src/componentRenderUtils.ts | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/packages/runtime-core/src/componentRenderUtils.ts b/packages/runtime-core/src/componentRenderUtils.ts index a1afae620..ebc381e76 100644 --- a/packages/runtime-core/src/componentRenderUtils.ts +++ b/packages/runtime-core/src/componentRenderUtils.ts @@ -110,24 +110,19 @@ export function renderComponentRoot( markAttrsAccessed() } result = normalizeVNode( - render.length > 1 - ? render( - __DEV__ ? shallowReadonly(props) : props, - __DEV__ - ? { - get attrs() { - markAttrsAccessed() - return shallowReadonly(attrs) - }, - slots, - emit, - } - : { attrs, slots, emit }, - ) - : render( - __DEV__ ? shallowReadonly(props) : props, - null as any /* we know it doesn't need it */, - ), + render( + __DEV__ ? shallowReadonly(props) : props, + __DEV__ + ? { + get attrs() { + markAttrsAccessed() + return shallowReadonly(attrs) + }, + slots, + emit, + } + : { attrs, slots, emit }, + ), ) fallthroughAttrs = Component.props ? attrs