lwc
lwc copied to clipboard
Hydration does not create custom elements
In a normal CSR (Client-Side Rendered) LWC scenario, we create custom elements (demo). So if you render <x-app>
and then do:
customElements.get('x-app')
... this will return an actual LWC element constructor.
In SSR+hydration, however, we don't create custom elements (demo).
So customElements.get('x-app')
returns undefined:
SSR+hydration should (ideally) result in the same thing as a pure CSR app. So hydration should result in custom elements being defined.
This issue has been linked to a new work item: W-11634909
Fixed by https://github.com/salesforce/lwc/pull/3802 although we need a follow-up PR for lifecycle events.