Skip to content

Commit

Permalink
Update _app.js to use a function component. (#16683)
Browse files Browse the repository at this point in the history
This PR updates the `_app.js` file to remove the `next/app` import. It's not needed with the latest versions of Next
  • Loading branch information
pkrawc committed Aug 30, 2020
1 parent 6926ab7 commit ba2fbc2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions examples/with-styled-components/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import App from 'next/app'
import { ThemeProvider } from 'styled-components'

const theme = {
Expand All @@ -7,13 +6,10 @@ const theme = {
},
}

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

0 comments on commit ba2fbc2

Please sign in to comment.