Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renderer): support modifying el in beforeMount #12719

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zenotsai
Copy link

Summary

This merge request updates the condition in the renderer to support modifying the el property during the beforeMount lifecycle hook.

Changes

  • Changed the condition from if (el && hydrateNode) to if (initialVNode.el && hydrateNode) in renderer.ts.

Reason

The modification allows developers to change the el property in the beforeMount lifecycle hook, providing more flexibility in the rendering process.

Testing

  • Verified that the el property can be modified in the beforeMount hook without causing issues during hydration.

@edison1105
Copy link
Member

This change will cause the following issues:

  • If el does not exist, adding el in beforeMount will cause the logic that should be mount to become hydrate.
  • If el exists, modifying el in beforeMount will cause a hydration mismatch.

@edison1105 edison1105 added the need more info Further information is requested label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants