React Hookers - v6.3.0
    Preparing search index...

    Interface Virtualizer

    A value returned from the useVirtualizer hook.

    interface Virtualizer {
        items: readonly VirtualItem[];
        estimateItemSize(index: number): number;
        estimateTotalSize(): number;
        scrollToIndex(
            index: number,
            options?: VirtualizerScrollToIndexOptions,
        ): void;
        scrollToPosition(position: number): void;
    }
    Index

    Properties

    items: readonly VirtualItem[]

    An array of items to render.

    Note: Items in this array may be reused between re-renders.

    Methods

    • Returns an estimated item size in pixels along the scroll axis, or the latest measured item size if item was previously rendered.

      Parameters

      • index: number

        An index of an item.

      Returns number

    • Returns an estimated total size of the virtualized list in pixels along the scroll axis, based on the total number of items and an estimated average item size.

      Returns number

    • Scrolls virtualizer to an absolute position.

      Note: The precision of the scroll position isn't guaranteed if an estimateTotalSize is greater then NumberConstructor.MAX_SAFE_INTEGER.

      Parameters

      • position: number

        A position in pixels to scroll to.

      Returns void