Skip to content

Instantly share code, notes, and snippets.

@unsign3d
Created September 7, 2018 09:07
Show Gist options
  • Save unsign3d/2e878d11f752a345dac2eaae75daed0c to your computer and use it in GitHub Desktop.
Save unsign3d/2e878d11f752a345dac2eaae75daed0c to your computer and use it in GitHub Desktop.
import React from 'react'
import {AppContextConsumer} from './AppContext'
const connect = (consumer, mapContextToProps = () => ({})) => (
<AppContextConsumer>{(context) => (
React.createElement(consumer, mapContextToProps(context))
)}
</AppContextConsumer>
)
export default connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment