Skip to content

Commit

Permalink
fix(suspense): give pending suspense vnode placeholder el
Browse files Browse the repository at this point in the history
close #10017
  • Loading branch information
yyx990803 committed Jan 10, 2024
1 parent 972face commit 228b8d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/__tests__/components/Suspense.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ describe('Suspense', () => {
expect(serializeInner(root)).toBe(`<div>sync</div>`)
})

// #6416 follow up
// #6416 follow up / #10017
test('Suspense patched during HOC async component re-mount', async () => {
const key = ref('k')
const data = ref('data')
Expand All @@ -1713,7 +1713,7 @@ describe('Suspense', () => {
const App = {
render() {
return h(Suspense, null, {
default: h(Comp, { data: data.value }),
default: h(Comp, { k: key.value, data: data.value }),
})
},
}
Expand Down
1 change: 1 addition & 0 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ function baseCreateRenderer(
if (!initialVNode.el) {
const placeholder = (instance.subTree = createVNode(Comment))
processCommentNode(null, placeholder, container!, anchor)
initialVNode.el = placeholder.el
}
} else {
setupRenderEffect(
Expand Down

0 comments on commit 228b8d6

Please sign in to comment.