import React from 'react' ; import App from 'next/app' ; import Head from 'next/head' ; import { ThemeProvider } from '@material-ui/styles' ; import CssBaseline from '@material-ui/core/CssBaseline' ; import { theme } from '../lib' ; class MyApp extends App { componentDidMount ( ) { const jssStyles = document . querySelector ( '#jss-server-side' ) ; if ( jssStyles ) { jssStyles . parentNode ! . removeChild ( jssStyles ) ; } } render ( ) { const { Component , pageProps } = this . props ; return ( < React . Fragment > < Head > < title > NESTPRESS < /title> < /Head> < ThemeProvider theme = { theme } > < CssBaseline /> < Component { ... pageProps } /> < /ThemeProvider> < /React.Fragment>); } } export default MyApp ;