Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Virtualized - Changing the height of a List Row post render

I'm using a List inside and AutoSizer with a dynamic height using a function for rowHeight. The row in my use case needs to render with ellipsis and expand upon clicking on it.

I'm wondering how to go about dynamically setting the rowHeight once the row has already been rendered?

like image 831
Anshul Koka Avatar asked Nov 24 '25 16:11

Anshul Koka


1 Answers

Here is an example of doing something similar (and here is the source code). The key part is here:

// When height changes externally, let List know to reset its cached size
List.recomputeRowHeights()
List.forceUpdate()
like image 154
bvaughn Avatar answered Nov 26 '25 04:11

bvaughn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!