diff --git a/packages/react/src/components/TreeView/TreeView.tsx b/packages/react/src/components/TreeView/TreeView.tsx index 56ad2dd84f5f..0c55ebf74781 100644 --- a/packages/react/src/components/TreeView/TreeView.tsx +++ b/packages/react/src/components/TreeView/TreeView.tsx @@ -49,7 +49,12 @@ export type TreeViewProps = { /** * Callback function that is called when any node is selected */ - onSelect?: (selected: Array, payload: any) => void; + onSelect?: ( + event: React.SyntheticEvent, + payload?: Partial & { + activeNodeId?: string | number; + } + ) => void; /** * Array representing all selected node IDs in the tree */ @@ -58,7 +63,7 @@ export type TreeViewProps = { * Specify the size of the tree from a list of available sizes. */ size?: 'xs' | 'sm'; -} & React.HTMLAttributes; +} & Omit, 'onSelect'>; type TreeViewComponent = { (props: TreeViewProps): JSX.Element;