example: Convert _app.js to functional components (#10115)

Fix formatting
This commit is contained in:
Michael Stramel 2020-01-20 15:13:04 -06:00 committed by Joe Haddad
parent 34f1aefa4a
commit ea0d916b50

View file

@ -1,20 +1,9 @@
import React from 'react'
import App from 'next/app'
class Layout extends React.Component {
render() {
const { children } = this.props
return <div className="layout">{children}</div>
}
}
const Layout = ({ children }) => <div className="layout">{children}</div>
export default class MyApp extends App {
render() {
const { Component, pageProps } = this.props
return (
<Layout>
<Component {...pageProps} />
</Layout>
)
}
}
export default ({ Component, pageProps }) => (
<Layout>
<Component {...pageProps} />
</Layout>
)