Closed brophdawg11 closed 3 years ago
Thanks for your contribution. I'm really happy to hear that it helps improving the performance metrics of your project. Looking forward to the PR.
I running into the same issue. Any fixes or workarounds?
I running into the same issue. Any fixes or workarounds?
Don't add classes on <LazyHydrate>
iself. <LazyHydrate>
does not render anything so adding classes does not make sense.
<LazyHydrate>
<div class="classes belong here"><!-- ... --></div>
</LazyHydrate>
When an element is mounted client side, if it is not yet hydrated, this only renders a
div
, but when theLazyhydrate
element has a class applied to it, it will blow away any internal classes from the root slot element.You can work around this at the moment by just never including classes or attributes on the
LazyHydrate
component, but that's a bit fragile since developers are quite used to classes/attrs being proxied through to the root child element I think (at least in our case this bit us fairly easily).I created a small reproduction in https://github.com/brophdawg11/vue-ssr-lazy-hydration-classname-bug to show off the issue, and I have a proposed fix I will open in a PR shortly.
Thanks for the great work on this component! It has helped our performance metrics a ton in our project 👍