-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Improve _app usage in nextjs examples #20381
Conversation
cf3ed29
to
c5aa16b
Compare
c5aa16b
to
3aeb975
Compare
Details of bundle changes.Comparing: 549bc5c...0aa9604 Details of page changes
|
3aeb975
to
d49f20d
Compare
@HaNdTriX Cool. I wasn't aware that we no longer have to extend |
@@ -1,34 +1,30 @@ | |||
import React from 'react'; | |||
import App from 'next/app'; | |||
import React, { useEffect } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import React from 'react';
import { ThemeProvider } from '@material-ui/core/styles'; | ||
import CssBaseline from '@material-ui/core/CssBaseline'; | ||
import theme from '../src/theme'; | ||
|
||
export default class MyApp extends App { | ||
componentDidMount() { | ||
export default function MyApp({ Component, pageProps }: AppProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default function MyApp(props: AppProps) {
// Remove the server-side injected CSS. | ||
const jssStyles = document.querySelector('#jss-server-side'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const jssStyles = document.querySelector('#jss-server-side');
Changelog
examples/nextjs
-_.app.js
Migrate to use functional componentexamples/nextjs
-_.app.js
Add prop-typesexamples/nextjs-with-typescript
-_.app.js
: Migrate to use functional component