【发布时间】:2016-04-28 23:54:35
【问题描述】:
很像这里的官方教程https://facebook.github.io/react-native/docs/tutorial.html:
我在ComponentDidMount 中调用了fetchData 方法,但根据this,ComponentDidMount 只会在组件初始渲染后调用一次。那么我是否应该在每次导航回此 ListView 之前调用相同的 fetchData,并将更新的数据作为道具传递给 ListView,然后在 componentDidUpdate 中相应地更新 listView 的状态参数?或者有没有更好的方法来做到这一点?
【问题讨论】:
-
看来redux很有前途,不知道有没有react native自带的好教程。
标签: facebook callback react-native react-native-listview