Skip to content

Commit

Permalink
fix: Add a story root wrapper for Suspense (fix #677) (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoattal authored Feb 19, 2024
1 parent 4b50490 commit c98417b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/histoire-plugin-vue/src/client/app/RenderStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ export default _defineComponent({
)
}

// Wrap in div to ensure only one root element
children.push(h('div', children.at(-1)))
// Wrap in Suspense to render async components
children.push(h(Suspense, {}, () => children.at(-1)))
children.push(h(Suspense, {}, children.at(-1)))

return children.at(-1)
},
Expand Down

0 comments on commit c98417b

Please sign in to comment.