Last active
October 20, 2020 22:02
-
-
Save AlbionaHoti/22688a0c4fac917a17f3ddaec13fc9b5 to your computer and use it in GitHub Desktop.
e-commerce-starter
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 '../assets/antd-custom.less'; | |
// Layout Component | |
import LayoutComponent from '../components/Layout'; | |
// React Context | |
import { CartProvider } from '../context/Context'; | |
// Apollo | |
import { ApolloProvider } from '@apollo/client'; | |
import { useApollo } from '../lib/apolloClient'; | |
export default function App({ Component, pageProps }) { | |
const apolloClient = useApollo(pageProps.initialApolloState); | |
// useApollo hook will initialize our apollo client | |
return ( | |
<ApolloProvider client={apolloClient}> | |
{/** | |
* | |
* ApolloProvider will privde the apolloClient | |
* to every single page of our application. | |
* | |
*/} | |
<CartProvider> | |
<LayoutComponent> | |
<Component {...pageProps} /> | |
</LayoutComponent> | |
</CartProvider> | |
</ApolloProvider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment