Skip to content

Commit

Permalink
type: correct type annotation for treeTitleRender (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyf665 authored Nov 9, 2024
1 parent fb1b6bb commit 919dced
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ online example: https://tree-select-react-component.vercel.app/
|treeNodeLabelProp | which prop value of treeNode will render as content of select | String | 'title' |
|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]}> | [] |
|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 |
|treeTitleRender | Custom render nodes | (nodeData: OptionType) => ReactNode |
|loadData | load data asynchronously | function(node) | - |
|getPopupContainer | container which popup select menu rendered into | function(trigger:Node):Node | function(){return document.body;} |
|autoClearSearchValue | auto clear search input value when multiple select is selected/deselected | boolean | true |
Expand Down Expand Up @@ -136,4 +137,4 @@ http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front

## License

rc-tree-select is released under the MIT license.
rc-tree-select is released under the MIT license.
2 changes: 1 addition & 1 deletion src/TreeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface TreeSelectProps<ValueType = any, OptionType extends DataNode =
listItemHeight?: number;
listItemScrollOffset?: number;
onDropdownVisibleChange?: (open: boolean) => void;
treeTitleRender?: (node: ValueType) => React.ReactNode;
treeTitleRender?: (node: OptionType) => React.ReactNode;

// >>> Tree
treeLine?: boolean;
Expand Down

0 comments on commit 919dced

Please sign in to comment.