bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.48k stars 778 forks source link

`.forceUpdate` is not working for VariableSizeList #731

Open timminata opened 11 months ago

timminata commented 11 months ago

I have seen several users commenting that dynamic heights that might change as your data changes are not working. Furthermore, we have tried to fix this issue by using the .forceUpdate() method, but it seems like even though the method is called, no change is observed. Only the first render is correct, then as data changes nothing is updating. I would appreciate if someone could point us in the right direction:

Here is a code sandbox illustrating that the heights do not change, as the "data" (in this case a simple modulus) changes: https://codesandbox.io/s/proud-leaf-9c38ch?file=/index.js

timminata commented 11 months ago

If anyone stumbles on this, it just so happens that after posting this I managed to fix my issue by using .resetAfterIndex(0), which resets and triggers an update. I'm leaving the issue open though as I would still like to understand why .forceUpdate() does not do what I would expect it to do.