Created
March 3, 2020 14:20
-
-
Save MobliMic/384704de03c2cff69a87996628bdb43a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NextApp from 'next/app'; | |
import React from 'react'; | |
import { ThemeProvider } from 'styled-components'; | |
const theme = { | |
primary: 'green' | |
}; | |
export default class App extends NextApp { | |
// remove it here | |
componentDidMount() { | |
const jssStyles = document.querySelector('#jss-server-side'); | |
if (jssStyles && jssStyles.parentNode) { | |
jssStyles.parentNode.removeChild(jssStyles); | |
} | |
} | |
render() { | |
const { Component, pageProps } = this.props; | |
return ( | |
<ThemeProvider theme={ theme }> | |
<Component { ...pageProps } /> | |
</ThemeProvider> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment