Unverified Commit 6b88dc55 authored by Mike Timmerman's avatar Mike Timmerman Committed by GitHub

Update code example on 01-pages-and-layouts.mdx (#60963)

Use nullish coalescing operator in all getLayout examples on
documentation page
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 7181d46f
......@@ -101,7 +101,7 @@ Page.getLayout = function getLayout(page) {
```jsx filename="pages/_app.js"
export default function MyApp({ Component, pageProps }) {
// Use the layout defined at the page level, if available
const getLayout = Component.getLayout || ((page) => page)
const getLayout = Component.getLayout ?? ((page) => page)
return getLayout(<Component {...pageProps} />)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment