Created
September 8, 2018 16:45
-
-
Save danielnmai/c2df9e78bbe729ffdfa04c4d8be8c68a to your computer and use it in GitHub Desktop.
Context Provider for App.js
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 PropTypes from 'prop-types' | |
import App from './App' | |
class ContextProvider extends React.Component { | |
static childContextTypes = { | |
insertCss: PropTypes.func, | |
} | |
getChildContext() { | |
return { ...this.props.context } | |
} | |
render () { | |
return <App { ...this.props } /> | |
} | |
} | |
export default ContextProvider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment