I have a ListView
, which, obviously, renders list of some items. Before, I was using React Native without Redux, so when my underlying data changes, I was calling setState()
, modifying the data, then dataSource = dataSource.cloneWithRows(itemsData);
, and it was quite performant: each row was re-rendered if only its data changes (i.e. if my rowHasChanged()
returned true
for that row).
But, the overall application design was quite ad-hoc and not very well maintainable, so I decided to try Redux.
Now, my scene is "pure", that is, it depends solely on the passed props, which are generated by means of mapStateToProps()
. But the problem is that whenever any item changes, the whole ListView
element is recreated, therefore, all items are re-rendered (my rowHasChanged()
is not even called). This is quite frustrating, since the only way to get rid of this behaviour is to make the scene non-pure again: add the state, and somehow update it when needed.
Or, what are other alternatives?