when using socket.io-client in react, the this direction inside the switching compenent, will be changed. What is the cause?
my socket.on is registered in compnentDidMount, but it is not destroyed when the component is removed, and the this point inside the callback time is retained. I tried to assign this to that, at the top of the componentDidMount, but the that.setState still does not take effect