Is it possible to force a ListView to re-render, even if the data in the dataSource has not changed? I have a ListView within a tab bar in my app and I want it to redraw eve
The best way to "update" this would be to clone the data item in question rather than doing a flag hack as the r1 !== r2
is already hinting at. Instead of updating an individual item, change the "pointer" itself by cloning.
For this particular issue update the item in the array like so.
arr[i] = { ...arr[i], someKey: newValue }
This will replace the "someKey" property with "newValue" and the current row will have a new pointer.
Here is a good resource to learn about immutability in modern JavaScript that react native uses: https://wecodetheweb.com/2016/02/12/immutable-javascript-using-es6-and-beyond/