Anshul Kai
Anshul Kai

Reputation: 4088

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?

Upvotes: 3

Views: 6795

Answers (1)

bvaughn
bvaughn

Reputation: 13487

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()

Upvotes: 4

Related Questions