if you are finding error in type scripting : Uncaught TypeError: Cannot read property 'setState' of undefined than here is the solution.
Whenever your ‘this’ is undefined you’re most likely not passing an arrow function to your event and you are going to loose the object.
private _onNextDismissBubble(): void {
this.setState({
isNextBubbleVisible: false
});
}
So to retain the function, please invoke this function inside the constructor.
this._onNextShowBubble = this._onNextShowBubble.bind(this);
follow this solution to avoid the typeError: Cannot read property 'setState'.
Happy Coding :)
Comments
Post a Comment