Skip to content

Commit 729c613

Browse files
bbb169afc163
andauthored
simplify loadDataFun change logic
Co-authored-by: afc163 <[email protected]>
1 parent 471df43 commit 729c613

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/OptionList.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,8 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
199199
const loadDataFun = useMemo(
200200
() => searchValue ? null : (loadData as any),
201201
[searchValue, treeExpandedKeys || expandedKeys],
202-
(pre, next) => {
203-
const [preSearchValue] = pre;
204-
const [nextSearchValue, nextExcludeSearchExpandedKeys] = next;
205-
206-
return (
207-
preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys)
208-
);
209-
},
202+
([preSearchValue], [nextSearchValue, nextExcludeSearchExpandedKeys]) =>
203+
preSearchValue !== nextSearchValue && (nextSearchValue || nextExcludeSearchExpandedKeys)
210204
);
211205

212206
// ========================== Render ==========================

0 commit comments

Comments
 (0)