-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(nuxt): remove fragment from createClientOnly
#7774
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
β Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! β€οΈ
This seems like a good fix to me. Is there a way we can add a test for the different kinds of client-only components? Maybe a page in the fixture with a variety of types and we can use createPage
to assert that all content is correctly displayed?
I think this should now cover most of the issues we can run into.
let me know if i missed something :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, and I'm really happy with the test suite - thank you π
i forgot to set .client on some test components |
createClientOnly
createClientOnly
updated #7774 (comment)
|
π Linked issue
linked to #6165 (comment)
resolves nuxt/nuxt#15014, resolves nuxt/nuxt#15039
β Type of change
π Description
Hi π π This PR remove the Fragment workaround which prevent using v-show on .client components even if it has a single root node.
There is additionnal changes in the setup part where we return the render function.
Previously in the linked PR, there's was a
Oldchildren is null
issue if we returned directly the setup result as a render function.Using the
h()
function to return the VNode was working only for some components (based on @danielroe 's #6165 (comment)).However the component fails to render or update its render silently if it only has a root tag with a string and a variable such as :
The workaround was to use a Fragment but it leads to nuxt/nuxt#15014 issue .
This is fixed by verifying the result of the render function
children
which can bestring|array|null|object
and rendering the component usingcreateElementVNode
when res.children is null or a stringπ Checklist