反应本机导航推送相同的屏幕

时间:2018-10-31 06:34:45

标签: reactjs react-native

我正在使用本机生成聊天应用。

当我单击通知时,我在聊天屏幕上,我在按下新的聊天屏幕。但是以前的聊天屏幕仍然运行。如果应用程序进入后台,则应用程序写入

  

1active 2active

 this.props.navigation.push({
                        routeName: goScreenName,
                        params:goScreenParameters  });

此事件导致套接字问题,如果没有StackActions.reset,如何解决此问题?

 _handleAppStateChange = (nextAppState) => {

            if (nextAppState.match(/inactive|background/)) {
                socket.emit('leaveRoom', "")
                console.log(this.state.chatID+"background ")
            }
            if (nextAppState.match(/active/)) {
                console.log(this.state.chatID+"active");
                socket.emit('chatRoom', this.state.chatID);
            }
          }

0 个答案:

没有答案
相关问题