Skip to content

Instantly share code, notes, and snippets.

@MobliMic
Created March 3, 2020 14:20
Show Gist options
  • Save MobliMic/384704de03c2cff69a87996628bdb43a to your computer and use it in GitHub Desktop.
Save MobliMic/384704de03c2cff69a87996628bdb43a to your computer and use it in GitHub Desktop.
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