2
我有我的路由器這樣的陣營掛載/卸載事件
<Route component={Home} exact path="/" />
<Route component={ChannelScreen} path="/channel/:channelId" />
首頁和ChannelScreen組件包含播放器組件。 所以當我改變頁面時,每次都會創建一個新玩家。但是,在componentWillUnmount之前調用Player componentDidMount事件。 玩家組件在銷燬另一個之前被重新創建。
不應該在創建新組件之前啓動componentWillUnmount嗎?
大聲笑,有趣的:d – croraf
我不知道答案,但你可以從這個https://github.com/facebook/react-native/commit/5eb3ab3522bd1d46fb4f8471c8207f1e0bc2cc25 – Yozi
你有反應,路由器哪個版本開始研究? – croraf