The React-Virtualized library is an implementation of virtual lists for use in React applications. It's quite optimized, and I think it uses a lot of links and interaction with the DOM to accomplish what it needs to do.
, React ( , ), -, .
1000 , 20. render. , 30 , 30-50. , React .
, , React , . , , , , . .
, , :
render() {
const {items} = this.props;
const {displaySize, startIndex} = this.state;
const itemsToDisplay = items.slice(startIndex, startIndex + displaySize + 1);
const renderedItems = itemsToDisplay.map( (item, index) => {
return <ListItem item={item} key={index} />
});
return (
<div>
{renderedItems}
</div>
);
}