gameboyVito / react-native-ultimate-listview

A high performance FlatList providing customised pull-to-refresh | auto-pagination & infinite-scrolling | gridview layout | swipeable-row.
https://www.npmjs.com/package/react-native-ultimate-listview
MIT License
540 stars 87 forks source link

updateRows,updateDataSource修改列表数据,页面无法渲染 #41

Closed tyf221578 closed 6 years ago

tyf221578 commented 6 years ago

列表数据中的某一条发生改编后,使用updateRows或者updateDataSource刷新当前页面的的数据,页面没有渲染,如果稍微滚动一下才会渲染,请问这个问题该如何解决呢?

"react": "16.0.0", "react-native": "0.50.1", "react-native-ultimate-listview": "^3.2.4"

tyf221578 commented 6 years ago

自己答一下吧,是自己没有理解删除数组方法的特性。 先获取到所有的rowData let rowData = this.listView.getRows(); 之后使用splice删掉一条,rowData.splice(0, 1) 问题就出在splice方法上,这个删除数组的方法会改变数组本身的结构,所以就造成上面描述的问题,希望能帮到其他小伙伴。

lfh22 commented 6 years ago

你最后是是怎么解决的?