You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add a footer to my page containing the generation timestamp. However, using new Date() does not really work as it is overriden with the current time after hydration. It would be great to have a <ServerOnly> component analog to the existing <ClientOnly> component.
I also tried to put it into defineAppConfig which is for "Public tokens that are determined at build time [...]" but that still leads to the date being hydrated on the client.
Additional information
Would you be willing to help implement this feature?
Using server components would mean that for every slightly different footer I would need a new component. The beauty of the <ClientOnly> component is that it simply accepts markup in its slot instead of requiring a new component for every area where it is used.
Having no lazy-hydration specific prop on < LazyHydrationWrapper> means it will never hydrate on client side.
There is also really nice nuxt-module to wrap vue3-lazy-hydration: https://github.com/Baroshem/nuxt-lazy-hydrate.
With this, you'd use <NuxtLazyHydrate> instead of <LazyHydrationWrapper>.
There is an open issue to bake this into nuxt. Hopefully it will land some day: #24242
Describe the feature
I would like to add a footer to my page containing the generation timestamp. However, using
new Date()
does not really work as it is overriden with the current time after hydration. It would be great to have a<ServerOnly>
component analog to the existing<ClientOnly>
component.I also tried to put it into
defineAppConfig
which is for "Public tokens that are determined at build time [...]" but that still leads to the date being hydrated on the client.Additional information
Final checks
The text was updated successfully, but these errors were encountered: