localhostess
localhostess
NNuxt
Created by localhostess on 6/2/2024 in #❓・help
Why does ssr/ssg client navigation change the page source?
I can't figure out this behavior. - I have my nuxt app rendering with ssr or ssg. - When i land on the root route "/" it servers the index document. I right click "view source" and i can see that static markup. - I click the nuxt-link on that page to "/test" route and i see a json payload xhr request come through: no new document in the network tab. but when i right click and view source again, i see the markup for test, not index. I thought only the server rendered page can be seen in the rightclick -> view source? This is a client-side navigation right? Why does it appear the original document is being altered?
4 replies
NNuxt
Created by localhostess on 5/23/2024 in #❓・help
Hydration mismatch for breakpoints
i have an isMobile ref that always throws a hydration mismatch. Its a composable that is a resize listener so it always knows if the viewport isMobile or not. On the server its false, on the client its true. This didn't happen with nuxt2. Right now as a workaround, i have to use an isMounted composable:
const isMounted = useMounted();
const isMounted = useMounted();
variable on my component like v-if=isMounted to not get that error. is there a better way?
6 replies