Skip to content

Commit 0f595ec

Browse files
committed
fix(custom-element): use PatchFlags.BAIL for slot when props are present
1 parent b555f02 commit 0f595ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-core/src/helpers/renderSlot.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function renderSlot(
3737
isAsyncWrapper(currentRenderingInstance!.parent) &&
3838
currentRenderingInstance!.parent.ce)
3939
) {
40+
const hasProps = Object.keys(props).length > 0
4041
// in custom element mode, render <slot/> as actual slot outlets
4142
// wrap it with a fragment because in shadowRoot: false mode the slot
4243
// element gets replaced by injected content
@@ -47,7 +48,7 @@ export function renderSlot(
4748
Fragment,
4849
null,
4950
[createVNode('slot', props, fallback && fallback())],
50-
PatchFlags.STABLE_FRAGMENT,
51+
hasProps ? PatchFlags.BAIL : PatchFlags.STABLE_FRAGMENT,
5152
)
5253
)
5354
}

0 commit comments

Comments
 (0)