Skip to content

Instantly share code, notes, and snippets.

@samcorcos
Created May 14, 2019 17:08
Show Gist options
  • Save samcorcos/f0cd6ea0fcf40623a0eda76731d75c3d to your computer and use it in GitHub Desktop.
Save samcorcos/f0cd6ea0fcf40623a0eda76731d75c3d to your computer and use it in GitHub Desktop.
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