bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.1k stars 3.05k forks source link

forceUpdate doesn't update the data if you passed isScrollingOptOut #1749

Open joshribakoff-sm opened 2 years ago

joshribakoff-sm commented 2 years ago

Related issues:

https://github.com/bvaughn/react-virtualized/issues/1028 https://github.com/bvaughn/react-virtualized/issues/719 https://github.com/bvaughn/react-virtualized/issues/1108 https://github.com/bvaughn/react-virtualized/issues/1489 https://github.com/bvaughn/react-virtualized/issues/1585 https://github.com/bvaughn/react-virtualized/issues/1104

When rendering Grid, I can also confirm isScrollingOptOut causes it to skip updating when I filter my data, the grid doesn't update (aside from a few rows as they scroll out of view and back in). Even forceUpdate and putting props on the Grid with Math.random() did not help to force a re-render.

I can set breakpoints and see that here in the code it hits the "if" and serves the cached cell contents, instead of hitting the "else" and re-rendering: https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/defaultCellRangeRenderer.js#L117-L132

Removing isScrollingOptOut fixes it