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