react setstate undefined code example Example: this.setState is undefined inside a async function in js .then((res) => this.setState({intentOptions: res.data}));