Uh oh!
There was an error while loading. Please reload this page.
fix(nuxt): remove fragment from createClientOnly - #7774
Conversation
|
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
danielroe
left a comment
There was a problem hiding this comment.
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 :) |
danielroe
left a comment
There was a problem hiding this comment.
This looks great, and I'm really happy with the test suite - thank you 😊
Uh oh!
There was an error while loading. Please reload this page.
huang-julien
commented
Sep 26, 2022
i forgot to set .client on some test components |
createClientOnlycreateClientOnlyupdated #7774 (comment)
|
🔗 Linked issue
linked to #6165 (comment)
resolvesnuxt/nuxt#15014, resolvesnuxt/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 nullissue 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
childrenwhich can bestring|array|null|objectand rendering the component usingcreateElementVNodewhen res.children is null or a string📝 Checklist