You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to use VirtualScroll, and InfiniteLoader together with CellMeasurer and AutoSizer. The problem I have is that I need to update the rows height after fetching some data (theres no way of knowing how tall it would be before hand), and I need to call recomputeRowHeights but for this I need to have a reference to the VirtualScroll which I cant cause im passing the registerChild from InfiniteLoader to the ref.
You can store a reference to VirtualScroll like so:
<InfiniteLoader{...props}>{({ onRowsRendered, registerChild })=>(<AutoSizer>{({ width, height })=>(<CellMeasurer{...props}>{({ getRowHeight, resetMeasurementForRow })=>{this._resetMeasurementForRow=resetMeasurementForRow;return(<VirtualScroll{...props}ref={(ref)=>{// Save it for yourself for laterthis._virtualScroll=ref// Pass it on to InfiniteLoader as wellregisterChild(ref)}}/>);}}</CellMeasurer>)}</AutoSizer>)}</InfiniteLoader>
Would like to open this again, as the answer is outdated using class components.
I'm having the same problem as described, but I'm not sure how to store the ref in a functional component, as you should be using the useRef hook. Any ideas?
Im trying to use VirtualScroll, and InfiniteLoader together with CellMeasurer and AutoSizer. The problem I have is that I need to update the rows height after fetching some data (theres no way of knowing how tall it would be before hand), and I need to call recomputeRowHeights but for this I need to have a reference to the VirtualScroll which I cant cause im passing the registerChild from InfiniteLoader to the ref.
Is this scenario supported?
The text was updated successfully, but these errors were encountered: