mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 15:10:58 +00:00
fix(nuxt): don't print layout warning if page is not ssr (#19434)
This commit is contained in:
parent
588c3ff24c
commit
a420369c90
@ -142,7 +142,7 @@ export const setPageLayout = (layout: string) => {
|
|||||||
useState('_layout').value = layout
|
useState('_layout').value = layout
|
||||||
}
|
}
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
if (process.dev && nuxtApp.isHydrating && useState('_layout').value !== layout) {
|
if (process.dev && nuxtApp.isHydrating && nuxtApp.payload.serverRendered && useState('_layout').value !== layout) {
|
||||||
console.warn('[warn] [nuxt] `setPageLayout` should not be called to change the layout during hydration as this will cause hydration errors.')
|
console.warn('[warn] [nuxt] `setPageLayout` should not be called to change the layout during hydration as this will cause hydration errors.')
|
||||||
}
|
}
|
||||||
const inMiddleware = isProcessingMiddleware()
|
const inMiddleware = isProcessingMiddleware()
|
||||||
|
Loading…
Reference in New Issue
Block a user