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

Pass default slot instead of raw children to components #1915

Merged
merged 2 commits into from
Oct 10, 2022

Conversation

thecrypticace
Copy link
Contributor

This is essentially how the internal implementation of <component> works. This works even for element VNodes.

The old implementation wasn't wrong but this normally lets Vue defer rendering of the slot (or even allow it to skip it in some cases). Given that we're calling the slot function ourselves that's not really the case. However, there's a potential future perf optimization where we only do this when as="template" (which we still still need because we have to flatten the VNode list for error checking)

Fixes #1892

This is essentially how the internal implementation of `<component>` works. This works even for element VNodes.
@vercel
Copy link

vercel bot commented Oct 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
headlessui-react ✅ Ready (Inspect) Visit Preview Oct 10, 2022 at 6:11PM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview Oct 10, 2022 at 6:11PM (UTC)

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

Successfully merging this pull request may close these issues.

Get Vue warning when using custom SFC component in MenuButton as prop
1 participant