fix(runtime-core): always pass context arg to functional components

This commit is contained in:
Alex Snezhko 2025-06-28 20:44:39 -07:00
parent ba391f5fdf
commit 37836c5796
1 changed files with 13 additions and 18 deletions

View File

@ -110,24 +110,19 @@ export function renderComponentRoot(
markAttrsAccessed() markAttrsAccessed()
} }
result = normalizeVNode( result = normalizeVNode(
render.length > 1 render(
? render( __DEV__ ? shallowReadonly(props) : props,
__DEV__ ? shallowReadonly(props) : props, __DEV__
__DEV__ ? {
? { get attrs() {
get attrs() { markAttrsAccessed()
markAttrsAccessed() return shallowReadonly(attrs)
return shallowReadonly(attrs) },
}, slots,
slots, emit,
emit, }
} : { attrs, slots, emit },
: { attrs, slots, emit }, ),
)
: render(
__DEV__ ? shallowReadonly(props) : props,
null as any /* we know it doesn't need it */,
),
) )
fallthroughAttrs = Component.props fallthroughAttrs = Component.props
? attrs ? attrs