why the change from virtualItem.measureElement -> virtualizer.measureElement + data-index attr? #617
-
I was using beta.2 in a production environment for quite a while now, and trying to upgrade locally broke a dynamic sized list of cards (similar to a news feed). What was the motivation for this change? to keep VirtualItem with only state and all the logic inside Virtualizer? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yep, that was the case, reading the size of element when scrolling is expensive, and with not stale refs we would have extra calls
https://reactjs-tw.github.io/docs/refs-and-the-dom.html#caveats-with-callback-refs Plus composing two measureElement like in grid example, row and column with item measureElement is not possible to keep it stale. |
Beta Was this translation helpful? Give feedback.
Yep, that was the case, reading the size of element when scrolling is expensive, and with not stale refs we would have extra calls
https://reactjs-tw.github.io/docs/refs-and-the-dom.html#caveats-with-callback-refs
Plus composing two measur…