From ffe87e51cce0b7f988a2e63529c922ad08a8183a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B1=AA?= <1844749591@qq.com> Date: Fri, 6 Dec 2024 16:40:30 +0800 Subject: [PATCH] fix: lint fix --- src/OptionList.tsx | 6 +++--- src/TreeSelectContext.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 {