Last active
June 16, 2017 20:33
-
-
Save tmeasday/c65890270df0b34ad2f95eefe7458021 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
| function buildReduxContainer(ChildComponentClass, mapStateToProps) { | |
| return class Container extends Component { | |
| render() { | |
| const { state } = this.context.store.getState(); | |
| const props = mapStateToProps(state); | |
| return <ChildComponentClass {...this.props} {...props} />; | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment