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[]

    The 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 most recently measured item size if the item has been rendered before.

      Parameters

      • index: number

        The item index.

      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 the virtualizer to an absolute position.

      Note: Scroll position precision is not guaranteed if estimateTotalSize is greater than NumberConstructor.MAX_SAFE_INTEGER.

      Parameters

      • position: number

        The scroll position, in pixels.

      Returns void