File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,18 @@ export default function useSearchConfig(
15
15
autoClearSearchValue,
16
16
} = props ;
17
17
return React . useMemo < [ boolean | undefined , SearchConfig < DefaultOptionType > ] > ( ( ) => {
18
+ const isObject = typeof showSearch === 'object' ;
18
19
const searchConfig = {
19
20
filterOption,
20
21
searchValue,
21
22
optionFilterProp,
22
23
filterSort,
23
24
onSearch,
24
25
autoClearSearchValue,
25
- ...( typeof showSearch === 'object' ? showSearch : { } ) ,
26
+ ...( isObject ? showSearch : { } ) ,
26
27
} ;
27
28
28
- if ( showSearch === false ) {
29
- return [ false , { } ] ;
30
- }
31
-
32
- if ( showSearch === undefined ) {
33
- return [ undefined , searchConfig ] ;
34
- }
35
-
36
- return [ true , searchConfig ] ;
29
+ return [ isObject ? true : showSearch , searchConfig ] ;
37
30
} , [
38
31
showSearch ,
39
32
filterOption ,
You can’t perform that action at this time.
0 commit comments