SyntaxFix
Write A Post
Hire A Developer
Questions
In my case, I was calling this.setState({}) correctly, but I my function wasn't bound to this, so it wasn't working. Adding .bind(this) to the function call or doing this.foo = this.foo.bind(this) in the constructor fixed it.
this.setState({})
.bind(this)
this.foo = this.foo.bind(this)