Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Hydration error while using v-if #45

Open
eljass opened this issue Mar 17, 2021 · 0 comments
Open

Hydration error while using v-if #45

eljass opened this issue Mar 17, 2021 · 0 comments

Comments

@eljass
Copy link

eljass commented Mar 17, 2021

We got a hydration error when showing other variants than the first one on the first visit on site. This is due to that the server-side code that contains active variation to be the first index and then immediately after the variant changes.

I used v-if to conditionally render the visible component. Using v-show fixes this error but then the first variant will flash at the first load. Is it possible to trigger variant selection before Nuxt creates HTML code in the server? Right now we have fixed this by wrapping these components inside <client-only> tags, but this shows a blank area (or placeholder) for the area where the component should appear.

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

No branches or pull requests

1 participant