Skip to content

Commit

Permalink
fix: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 committed Dec 6, 2024
1 parent c8b2c92 commit ffe87e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
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);
Expand Down
2 changes: 1 addition & 1 deletion src/TreeSelectContext.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit ffe87e5

Please sign in to comment.