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

refactor(noElement): use the full array of VNodes from the default slot #1474

Merged
merged 2 commits into from
May 22, 2024

Conversation

diegopf
Copy link
Contributor

@diegopf diegopf commented May 15, 2024

This PR refactors the useNoElementRender composable to return the full VNodes array from the default slot, instead of just the first VNode. The former approach only works for Vue 2 where components can only have one single root node. However, Vue 3 allows having multiple root nodes for a component and it will break the NoElement usage.

Thanks to the composition API is posible to use a render function that returns multiple VNodes via the return of the setup method. See declaring render functions
Once this PR is merged we could rollback some changes from #1460 and save the extra div that were needed here for BannersList, ResultsList, PromotedsList and NextQueriesList

@diegopf diegopf requested a review from a team as a code owner May 15, 2024 14:11
@diegopf diegopf changed the title refactor: use refactor(noElement): use the full array of VNodes from the default slot May 15, 2024
@diegopf diegopf merged commit 8fb904c into main May 22, 2024
4 checks passed
@diegopf diegopf deleted the refactor/no-element branch May 22, 2024 08:06
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.

2 participants