import React from 'react'
import App, { Container } from 'next/app'

export default class MyApp extends App {
  render () {
    const { Component, pageProps } = this.props
    return (
      <Container>
        <Component.Layout>
          <Component {...pageProps} />
        </Component.Layout>
      </Container>
    )
  }
}

import React from 'react'
import App from 'next/app'

const Noop = ({ children }) => children

export default class MyApp extends App {
  render () {
    const { Component, pageProps } = this.props
    const Layout = Component.Layout || Noop

    return (
      <Layout>
        <Component {...pageProps} />
      </Layout>
    )
  }
}

Fix layout example building (#8326)