Created
May 14, 2019 17:08
-
-
Save samcorcos/f0cd6ea0fcf40623a0eda76731d75c3d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 App, { Container } from 'next/app' | |
import { firebase } from '../lib/firebase' | |
import { Context, Provider } from '../lib/context' | |
// Use this additional container to bind firebase auth listener to store | |
class _App extends App { | |
render () { | |
const { Component, pageProps } = this.props | |
return ( | |
<Container> | |
<Provider> | |
<Context.Consumer> | |
{store => ( | |
<> | |
<Component store={store} {...pageProps} /> | |
</> | |
)} | |
</Context.Consumer> | |
</Provider> | |
</Container> | |
) | |
} | |
} | |
export default _App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment