Created
November 30, 2018 03:13
-
-
Save Jahans3/fb770633b1d1000829378de8c9042003 to your computer and use it in GitHub Desktop.
Dispatch placeholder
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
export class Provider extends React.PureComponent { | |
static defaultProps = { | |
state: {} | |
}; | |
state = this.props.state; | |
_dispatch = action => {}; | |
render () { | |
return ( | |
<StateContext.Provider value={{ state: this.state, dispatch: this._dispatch }}> | |
{this.props.children} | |
</StateContext.Provider> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment