@dxos/react-ui-list
    Preparing search index...

    Type Alias ReorderListController<T>

    Stable controller created by useReorderList. Item components consume it via useReorderItem(controller, id). The controller is reference-stable across renders.

    type ReorderListController<T> = {
        bindItem: (
            id: string,
            refs: { handle: HTMLElement; row: HTMLElement },
            onItemState: (state: ReorderItemState) => void,
        ) => () => void;
        getItem: (id: string) => { index: number; item: T } | null;
        listId: string;
    }

    Type Parameters

    • T
    Index

    Properties

    bindItem: (
        id: string,
        refs: { handle: HTMLElement; row: HTMLElement },
        onItemState: (state: ReorderItemState) => void,
    ) => () => void

    Bind a row's pragmatic-dnd primitives. Idempotent; returns a cleanup function.

    getItem: (id: string) => { index: number; item: T } | null

    Look up an item by id. Used by the item hook to bind pragmatic-dnd at register time.

    listId: string

    Internal: list id; payload tagged with this is the only data the monitor accepts by default.