mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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
|
||||
}
|
||||
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.')
|
||||
}
|
||||
const inMiddleware = isProcessingMiddleware()
|
||||
|
Loading…
Reference in New Issue
Block a user