gcrabtree/react-native-socketio

Android socket event is global,and open new socket the old event is still there

huangjilaiqin opened this issue · 0 comments

image
first I just close socket in componentWillUnmount,but when I navigatior to this Sence the register function will be called twice, then I navigator.pop and navigator.push the sence again, the register function will be called 3 times. It seems the register function was storage at global queue!!!
I solve my problem: register 'do nothing function ' at componentWillUnmount,if not myTest event fun,have call setState,it will lead to excpetion:setState Can only update a mounted or mounting component.

Do I make myself clear?