bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.48k stars 778 forks source link

Can I replace the blank spaces which is caused by scrolling fast with other components? #743

Open Derigion opened 8 months ago

Derigion commented 8 months ago

Since items in a virtualized list only change when the user scrolls, blank space can briefly flash as newer entries are about to be displayed. I want to replace the blank spaces with some components to tell the users it's rendering.

alejandrorascovan commented 2 weeks ago

In your row component definition, you could first check if data[index] is undefined for example. I do something like this:

const Row = ({ data, index, style }) => {
    if (data[index] === undefined) return (<div style={style}><LoadingOrError /></div>);
...