Repository: nuxt/nuxt
File: packages/nuxt/src/app/components/nuxt-layout.ts (TypeScript)

Code before:
        }
        if (props.fallback) {
          layout = unref(props.fallback)
        }
      }
      return layout
    })

    const layoutRef = ref()
    context.expose({ layoutRef })

    const done = nuxtApp.deferHydration()
    if (import.meta.client && nuxtApp.isHydrating) {
      const removeErrorHook = nuxtApp.hooks.hookOnce('app:error', done)
      useRouter().beforeEach(removeErrorHook)
    }

    if (import.meta.dev) {
      nuxtApp._isNuxtLayoutUsed = true
    }

    let lastLayout: string | boolean | undefined

    return () => {
      const hasLayout = layout.value && layout.value in layouts
      const transitionProps = route!.meta.layoutTransition ?? defaultLayoutTransition

      const previouslyRenderedLayout = lastLayout
      lastLayout = layout.value

      // We avoid rendering layout transition if there is no layout to render
      return _wrapInTransition(hasLayout && transitionProps, {
        default: () => h(Suspense, { suspensible: true, onResolve: () => { nextTick(done) } }, {
          default: () => h(
            LayoutProvider,
            {
              layoutProps: mergeProps(context.attrs, { ref: layoutRef }),
              key: layout.value || undefined,
              name: layout.value,
              shouldProvide: !props.name,
              isRenderingNewLayout: (name?: string | boolean) => {
                return (name !== previouslyRenderedLayout && name === layout.value)
              },
              hasTransition: !!transitionProps,
            }, context.slots),
        }),
      }).default()
    }
  },
}) as DefineComponent<ExtractPublicPropTypes<typeof nuxtLayoutProps>>


Review comment (suggestion):
```suggestion
      const transitionProps = route?.meta.layoutTransition ?? defaultLayoutTransition
```

Code after:
        }
        if (props.fallback) {
          layout = unref(props.fallback)
        }
      }
      return layout
    })

    const layoutRef = ref()
    context.expose({ layoutRef })

    const done = nuxtApp.deferHydration()
    if (import.meta.client && nuxtApp.isHydrating) {
      const removeErrorHook = nuxtApp.hooks.hookOnce('app:error', done)
      useRouter().beforeEach(removeErrorHook)
    }

    if (import.meta.dev) {
      nuxtApp._isNuxtLayoutUsed = true
    }

    let lastLayout: string | boolean | undefined

    return () => {
      const hasLayout = layout.value && layout.value in layouts
      const transitionProps = route?.meta.layoutTransition ?? defaultLayoutTransition

      const previouslyRenderedLayout = lastLayout
      lastLayout = layout.value

      // We avoid rendering layout transition if there is no layout to render
      return _wrapInTransition(hasLayout && transitionProps, {
        default: () => h(Suspense, { suspensible: true, onResolve: () => { nextTick(done) } }, {
          default: () => h(
            LayoutProvider,
            {
              layoutProps: mergeProps(context.attrs, { ref: layoutRef }),
              key: layout.value || undefined,
              name: layout.value,
              shouldProvide: !props.name,
              isRenderingNewLayout: (name?: string | boolean) => {
                return (name !== previouslyRenderedLayout && name === layout.value)
              },
              hasTransition: !!transitionProps,
            }, context.slots),
        }),
      }).default()
    }
  },
}) as DefineComponent<ExtractPublicPropTypes<typeof nuxtLayoutProps>>