Skip to content

Functional components render slots with strings as empty divs #693

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

Closed
danielsdeboer opened this issue Jun 8, 2018 · 1 comment
Closed

Comments

@danielsdeboer
Copy link

danielsdeboer commented Jun 8, 2018

Version

1.0.0-beta.16

Reproduction link

https://codesandbox.io/s/j376k9jvv

Steps to reproduce

  • Create a basic functional component that renders content from the default slot
  • Attempt to mount the component with a string in the default slot

What is expected?

Should render the string, eg <p>Some string</p>

What is actually happening?

Test utils renders an empty <div>, eg <p><div></div></p>


The component works as expected outside of the test environment. See the repro, where slotted content renders as expected.

@danielsdeboer danielsdeboer changed the title Function components render slots with strings as empty divs Functional components render slots with strings as empty divs Jun 8, 2018
@kfischer-okarin
Copy link

Since version 1.0.0-beta.17 it also shows following warning:

[Vue warn]: Error compiling template:
    
text content
    
- Component template requires a root element, rather than just text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants