I am a little sure how to achieve dynamic list heights using react-virtualized .
I have a component as follows:
import { List } from 'react-virtualized';
<List
height={400}
rowCount={_.size(messages)}
rowHeight={(index) => {
return 100;
}}
rowRenderer={({ key, index, style }) => <Message style={style} {...messages[index]} />}}
width={300}
/>
I examined the use of CellMeasurer according to the docs that say it can be used with the List component, but I have no idea how this example really works ...
I also tried to figure out how this was achieved in the demo code but also reached a dead end.
Can someone please help me in how I will measure the DOM in order to dynamically receive each position.
source
share