Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspense regression: Story now accept only one child #677

Closed
6 tasks done
hugoattal opened this issue Feb 8, 2024 · 2 comments · Fixed by #678
Closed
6 tasks done

Suspense regression: Story now accept only one child #677

hugoattal opened this issue Feb 8, 2024 · 2 comments · Fixed by #678
Assignees
Labels
bug Something isn't working has-workaround

Comments

@hugoattal
Copy link
Collaborator

hugoattal commented Feb 8, 2024

Describe the bug

Following 26dd6ed

Vue fire a warning when there are several child nodes in a story

[Vue warn]: <Suspense> slots expect a single root node. 
  at <RenderStorySubApp>

Maybe this should be an opt-in feature?
Like this: <Story suspense>...</Story>

Or wrap the inside of Suspense into a div?

Reproduction

<template>
  <Story>
    <div>Hello</div>
    <div>World</div>
  </Story>
</template>

Workaround:

<template>
  <Story>
    <div>
      <div>Hello</div>
      <div>World</div>
    </div>
  </Story>
</template>

System Info

All

Used Package Manager

pnpm

Validations

@hugoattal hugoattal added the to triage This issue needs to be triaged label Feb 8, 2024
@hugoattal
Copy link
Collaborator Author

@Akryum I can do the fix if you want.

Two solutions:

  • opt-in (<Story suspense>...</Story>)
  • or add a wrapper (<Suspense><div><Story ... /></div></Suspense>)

@hugoattal hugoattal added bug Something isn't working has-workaround and removed to triage This issue needs to be triaged labels Feb 8, 2024
@Akryum
Copy link
Member

Akryum commented Feb 8, 2024

I'm in favor of the wrapper div

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants