react-native-waterfall icon indicating copy to clipboard operation
react-native-waterfall copied to clipboard

refresh 之后 新数据如何添加到瀑布流

Open huaziHear opened this issue 7 years ago • 1 comments

按照我的理解,首先调用clear清空数据,然后调用了addItemsWithHeight新增一批数据。但是没有任何反应,clear是异步的,addItemsWithHeight也是异步的。怎么样写,才是正确的姿势呢

huaziHear avatar Oct 26 '18 10:10 huaziHear

api的设计可能对使用状态管理工具的场景下不太友好

huaziHear avatar Oct 26 '18 11:10 huaziHear

由于clear和addItemsWithHeight里面使用了setState,而setState是异步的,所以确实会存在这个问题,感谢提出Issues,抱拳了老铁

junhaotong avatar Nov 05 '18 02:11 junhaotong