diff --git a/src/OptionList.tsx b/src/OptionList.tsx index 2d5aecda..61810ddc 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -175,15 +175,15 @@ const OptionList: React.ForwardRefRenderFunction = (_, resetCache(); }, [checkedKeys, maxCount]); - const getSelectableKeys = (targetNode: DataNode, fieldNames: FieldNames): Key[] => { - const keys = [targetNode[fieldNames.value]]; + const getSelectableKeys = (targetNode: DataNode, names: FieldNames): Key[] => { + const keys = [targetNode[names.value]]; if (!Array.isArray(targetNode.children)) { return keys; } return targetNode.children.reduce((acc, child) => { if (!child.disabled) { - acc.push(...getSelectableKeys(child, fieldNames)); + acc.push(...getSelectableKeys(child, names)); } return acc; }, keys); diff --git a/src/TreeSelectContext.ts b/src/TreeSelectContext.ts index c1a7f042..82480262 100644 --- a/src/TreeSelectContext.ts +++ b/src/TreeSelectContext.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import type { ExpandAction } from 'rc-tree/lib/Tree'; -import type { DataNode, FieldNames, Key, LabeledValueType } from './interface'; +import type { DataNode, FieldNames, Key } from './interface'; import { CheckedStrategy } from './utils/strategyUtil'; export interface TreeSelectContextProps {