Skip to content

Instantly share code, notes, and snippets.

Last active Dec 16, 2018
What would you like to do?
Updating our state
export class StateProvider extends Component {
static defaultProps = {
state: {}
state = this.props.state;
render () {
return (
<Provider value={{ state: this.state, setState: this.setState.bind(this) }}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment