提交 ea0d916b 编写于 作者: M Michael Stramel 提交者: Joe Haddad

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

Fix formatting
上级 34f1aefa
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>
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册