【发布时间】:2017-05-28 11:10:04
【问题描述】:
我有 2 个组件,组件 a 和组件 b
我想在更改状态后从组件 a 导航到组件 b。 当我改变状态时,它会触发我的 componentWillReceiveProps 函数,我从那里导航。
componentWillReceiveProps(nextProps) {
const { navigate } = nextProps.navigation;
navigate('b');
}
现在我进入了一个无限循环,它开始一次又一次地触发 componentWillReceiveProps 而不是导航
需要帮助。
【问题讨论】:
标签: react-native react-redux react-navigation