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

"never" seems to trigger mounted() nonetheless #80

Open
simplenotezy opened this issue Nov 19, 2020 · 6 comments
Open

"never" seems to trigger mounted() nonetheless #80

simplenotezy opened this issue Nov 19, 2020 · 6 comments
Assignees

Comments

@simplenotezy
Copy link

I have a very simple component like so:

	<LazyHydrate never :trigger-hydration="false">
		<FreeShippingPopUp />
	</LazyHydrate>

And inside FreeShippingPopUp.vue I have this:

mounted () {
	alert('I am hydrated!');
}

However, the popup appears on the page, which I would expect it wouldn't since it's set to "never". Using version ^2.0.0-beta.2

@maoberlehner
Copy link
Owner

Can't reproduce.

@milindsingh
Copy link

The following condition is always true. I am using never in gridsome but client-side rendering is always happening.

if (this.$el.nodeType === Node.COMMENT_NODE) 

@milindsingh
Copy link

@noxify and I have tested on the sandbox and it always triggers the mounted method.

@maoberlehner Any idea whats wrong? We could fix it if you just guide us in the right direction. Thanks

V1: https://codesandbox.io/s/vue-lazy-hydration-example-v1-n99ov
V2: https://codesandbox.io/s/vue-lazy-hydration-example-v2-umbgy

@maoberlehner
Copy link
Owner

@milindsingh vue-lazy-hydration allows you to delay or block the hydration of server-side rendered Vue.js components. In your CodeSandbox example there is no server-side rendering going on. If there is no server-side rendered HTML there also is no hydration. So this package is useless in your examples. If vue-lazy-hydration would block mounting in your example, the component wouldn't render at all. I'm not sure what you expect vue-lazy-hydration to do in a pure client-side context?

@milindsingh
Copy link

@maoberlehner Thanks for clearification. I totally understand your point.

I am facing issue with gridsome, where initially ssr content is display but once the page loading done in browser the ssr content is replaced by the new content rendered by component.

@maoberlehner
Copy link
Owner

I am facing issue with gridsome

Then show me a minimal reproduction of your problem with Gridsome on CodeSandbox 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants