Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

docs: add warning about .client onMounted hook - #9263

Merged
danielroe merged 3 commits into
nuxt:mainfrom
huang-julien:docs/client_onmounted
Nov 24, 2022
Merged

docs: add warning about .client onMounted hook#9263
danielroe merged 3 commits into
nuxt:mainfrom
huang-julien:docs/client_onmounted

Conversation

@huang-julien

@huang-julienhuang-julien commented Nov 22, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#15551

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

hi 👋 This PR warns about the onMounted hooks on .client components.

Since the createClientOnly only render the component after being mounted, we don't have any access to the rendered template defined on the .vue file before the nextTick

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

Comment threaddocs/content/1.docs/2.guide/2.directory-structure/1.components.md Outdated
@danielroedanielroe added the documentation Improvements or additions to documentation label Nov 23, 2022

@danielroedanielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! ❤️

@danielroedanielroe changed the title docs(guide): add warning about .client onMounted hookdocs: add warning about .client onMounted hookNov 24, 2022
@danielroe
danielroe merged commit f1026d4 into nuxt:mainNov 24, 2022
@pi0pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroedanielroe mentioned this pull request Jan 20, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xdocumentationImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template refs in .client components not available at onMounted()

2 participants

@huang-julien@danielroe