亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

React-Native中使用react-navigation,A跳轉到B時未觸發A

React-Native中使用react-navigation,A跳轉到B時未觸發A

眼眸繁星 2019-03-08 14:11:07
在React-Native的項目中使用組件react-navigation進行頁面路由管理,在A組件的componentDidMount中開啟一個定時器,并在componentWillUnmount中進行清除。A頁面使用this.props.navigation.navigate('B')跳轉到B頁面后,發現componentWillUnmount未被執行對于該組件的問題網上有如下回答:Navigator uses stack to manager route. When you push a new page,current page wont unmount, if you pop from new page to the currentpage, the new page will unmount. And in other scene, if you rendersome child component based on some regulation like isLoading or other,the componentWillUnmount method will also be called when they nolonger need to be rendered.react-navigation組件中存在這樣的天然缺陷,不知各位如何應對componentWillUnmount生命周期未調用的場景
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 1625 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號