interface LazyTreeViewProps<T> {
    foldControls?: RefObject<TreeFoldControls>;
    onFold?: OnFoldHandler;
    placeholder?: ComponentType<{
        data-key?: string;
        style?: CSSProperties;
    }>;
    placeholderHeight: number;
    renderer: TreeNodeComponent<T>;
    startClosed?: boolean;
    value: MutableRefObject<T>;
}

Type Parameters

  • T extends Tree<any>

    the type of tree that the component prop will be rendering

Properties

foldControls?: RefObject<TreeFoldControls>

pass the return value of useFoldControls into this prop to allow external control of a tree's fold state

onFold?: OnFoldHandler

a callback that is fired when one or more nodes is fired

placeholder?: ComponentType<{
    data-key?: string;
    style?: CSSProperties;
}>

the element that will be rendered as a placeholder when the node is off-screen. defaults to a simple div.

Type declaration

  • Optional data-key?: string
  • Optional style?: CSSProperties
placeholderHeight: number

the height of a placeholder, in pixels. this should be approximately the same height as your on-screen nodes.

renderer: TreeNodeComponent<T>

the component that will be used to render the tree's nodes.

startClosed?: boolean

used to indicate what the default fold state is for nodes.

value: MutableRefObject<T>

a RefObject of the tree that will be rendered.