我在 react-native redux 中从 api 获取数据但是当我调用componentDidMount()
函数时,它会获取数据并且它一次运行一次,但是当我调用componentDidMount()
更新componentDidUpdate()
我在设置页面中更改并保存在 redux 状态的数据时,我模拟器被挂起并且componentDidUpdate()
函数在第二个循环中运行很多时间。
有什么方法可以阻止它,它应该一次运行一次?if else
健康)状况 ?
真正的调用方法是componentDidMount() with componentDidUpdate()
什么?