Reference home > @af-utils/virtual-react > useVirtual

useVirtual() function

React hook. Calls useVirtualModel() and synchronizes it with props

Signature:

useVirtual: (params: VirtualScrollerInitialParams) => VirtualScroller

Parameters

Parameter

Type

Description

params

VirtualScrollerInitialParams

Returns

VirtualScroller

Remarks

VirtualScroller.set() is called internally to syncchronize model with props.

Example

useVirtual({
    itemCount: 1000,
    estimatedItemSize: 100,
    overscanCount: 1
});