Modify size of element on click
Each row can be clicked, which expands the row to show more data. I'm storing the state of what's open within a state object
Record<string, boolean
.
My estimate size fn looks like:
This works when new data comes in, however useVirtualizer doesn't seem to re-render when my own state changes. Is there a way to handle this?2 Replies
harsh-harlequinOP•2y ago
Ah got it,
virtual.resizeItem(item, isOpen ? 150 : 28);
ambitious-aqua•2y ago
Ooo true, because now
estimateSize
is not a dependency when building measurements array it's not easy to update the sizes.
We can change it but then estimateSize need to be stale, nevertheless we should change the signature of resizeItem, to resive key not a virutal item
cc @Tanner Linsley what do you think?