Typeerror: _this2.setstate Is Not A Function, Cant Bind State
I am getting this this error. As I am already using ES6 format, That arrow but also getting same error. And somewhat confuse that how to use bind. How can I get out of this error.
Just to be clear about which this
you're trying to reference, could you do this?
async fetchData() {
const ctx = this
And then reference ctx
instead of this
:
ctx.setState({
ver: responseData.results.appversion,
});
You may like these posts
Post a Comment for "Typeerror: _this2.setstate Is Not A Function, Cant Bind State"