Skip to content

Commit 919dced

Browse files
authoredNov 9, 2024
type: correct type annotation for treeTitleRender (#595)
1 parent fb1b6bb commit 919dced

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ online example: https://tree-select-react-component.vercel.app/
9797
|treeNodeLabelProp | which prop value of treeNode will render as content of select | String | 'title' |
9898
|treeData | treeNodes data Array, if set it then you need not to construct children TreeNode. (value should be unique across the whole array) | array<{value,label,children, [disabled,selectable]}> | [] |
9999
|treeDataSimpleMode | enable simple mode of treeData.(treeData should be like this: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` is parent node's id) | bool/object{id:'id', pId:'pId', rootPId:null} | false |
100+
|treeTitleRender | Custom render nodes | (nodeData: OptionType) => ReactNode |
100101
|loadData | load data asynchronously | function(node) | - |
101102
|getPopupContainer | container which popup select menu rendered into | function(trigger:Node):Node | function(){return document.body;} |
102103
|autoClearSearchValue | auto clear search input value when multiple select is selected/deselected | boolean | true |
@@ -136,4 +137,4 @@ http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front
136137

137138
## License
138139

139-
rc-tree-select is released under the MIT license.
140+
rc-tree-select is released under the MIT license.

‎src/TreeSelect.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
9393
listItemHeight?: number;
9494
listItemScrollOffset?: number;
9595
onDropdownVisibleChange?: (open: boolean) => void;
96-
treeTitleRender?: (node: ValueType) => React.ReactNode;
96+
treeTitleRender?: (node: OptionType) => React.ReactNode;
9797

9898
// >>> Tree
9999
treeLine?: boolean;

0 commit comments

Comments
 (0)