example: Convert _app.js to functional components (#10115)
Fix formatting
This commit is contained in:
parent
34f1aefa4a
commit
ea0d916b50
1 changed files with 6 additions and 17 deletions
|
@ -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>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue