interface TreeNodeComponentProps<T> {
    childKeys: readonly string[];
    nodeKey: string;
    parentKey: null | string;
    treeRef: MutableRefObject<T>;
    value: PayloadOf<T>;
}

Type Parameters

  • T extends Tree<any>

    the type of tree that the component prop will be rendering

Properties

childKeys: readonly string[]

a list of child nodes. Useful to know if this is a leaf node or not.

nodeKey: string

the key of the node being rendered

parentKey: null | string

the key of this node's parent, or null if it is a root

treeRef: MutableRefObject<T>

a reference to the tree object. Note that this should not be relied upon for reactive updates directly, but rather to access it's methods.

value: PayloadOf<T>

the value of this node of the tree