framework icon indicating copy to clipboard operation
framework copied to clipboard

docs(guide): add warning about .client onMounted hook

Open huang-julien opened this issue 3 years ago • 1 comments

🔗 Linked issue

resolve https://github.com/nuxt/framework/issues/9185

❓ Type of change

  • [x] 📖 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 :wave: 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

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

huang-julien avatar Nov 22 '22 20:11 huang-julien

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

codesandbox[bot] avatar Nov 22 '22 20:11 codesandbox[bot]