Handling scrolling

Loading and rendering images while scrolling ruins the scrolling performance.

To deal with this, the Virtuoso component emits scrollingStateChange when the user starts / stops scrolling. The callback receives true when the user starts scrolling and false shortly after the last scroll event.

Handling this event can be used to optimize performance by hiding/replacing certain elements in the items.

In the example above, the image avatars are replaced with placeholders when the user starts scrolling.