setState() may have delayed effect
This is because it is asynchronous method.
Reading this.state may get the wrong state.
Solution:
Try to use callback functions for setState().
setState() may have delayed effect
This is because it is asynchronous method.
Reading this.state may get the wrong state.
Solution:
Try to use callback functions for setState().