Skip to content

Commit 27d6653

Browse files
committed
chore: remove deps
1 parent 7d7c91b commit 27d6653

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/components/select/hooks/useOptions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ function useOptions(
7474
const { valueKey } = getKeyMapping(keys);
7575
const mergedValueToOption = { ...newValueToOption };
7676

77-
// 保持之前选中的 option 在映射中
78-
// 避免远程搜索时,选中的 option 状态丢失
77+
// 保持之前选中的 option 在映射中,避免远程搜索时,状态丢失
7978
Object.keys(prevValueToOption).forEach((key) => {
8079
if (mergedValueToOption[key]) return;
8180
const isSelected = Array.isArray(value)
@@ -90,7 +89,7 @@ function useOptions(
9089
return mergedValueToOption;
9190
});
9291
// eslint-disable-next-line react-hooks/exhaustive-deps
93-
}, [options, keys, children, reserveKeyword, value, valueType]);
92+
}, [options, keys, children, reserveKeyword]);
9493

9594
// 同步 value 对应的 options
9695
useEffect(() => {

0 commit comments

Comments
 (0)