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

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-julien huang-julien commented Nov 22, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves nuxt/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

codesandbox Bot commented Nov 22, 2022

Copy link
Copy Markdown

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

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

@danielroe danielroe 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! ❤️

@danielroe danielroe changed the title docs(guide): add warning about .client onMounted hook docs: add warning about .client onMounted hook Nov 24, 2022
@danielroe
danielroe merged commit f1026d4 into nuxt:main Nov 24, 2022
@pi0 pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x documentation Improvements 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