Created
June 22, 2020 09:47
-
-
Save daniilgri/2c341998e7ece0cc4fbcb9b9b7916de7 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 React from "react"; | |
import NextApp from "next/app"; | |
import { ModalProvider } from "styled-react-modal"; | |
import { StyleSheetManager } from "styled-components"; | |
import store from "../store"; | |
import { GlobalStyle } from "../styles/App/styles"; | |
GlobalStyle; | |
class App extends NextApp { | |
static async getInitialProps({ Component, ctx }) { | |
const pageProps = Component.getInitialProps | |
? await Component.getInitialProps(ctx) | |
: {}; | |
//Anything returned here can be access by the client | |
return { pageProps: pageProps }; | |
} | |
render() { | |
const { Component, pageProps } = this.props; | |
return ( | |
<StyleSheetManager disableCSSOMInjection> | |
<ModalProvider> | |
<GlobalStyle /> | |
<Component {...pageProps} /> | |
</ModalProvider> | |
</StyleSheetManager> | |
); | |
} | |
} | |
export default store.withRedux(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment