Skip to content

Instantly share code, notes, and snippets.

@Jahans3
Created November 30, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jahans3/fb770633b1d1000829378de8c9042003 to your computer and use it in GitHub Desktop.
Save Jahans3/fb770633b1d1000829378de8c9042003 to your computer and use it in GitHub Desktop.
Dispatch placeholder
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