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(
1515 autoClearSearchValue,
1616 } = props ;
1717 return React . useMemo < [ boolean | undefined , SearchConfig < DefaultOptionType > ] > ( ( ) => {
18+ const isObject = typeof showSearch === 'object' ;
1819 const searchConfig = {
1920 filterOption,
2021 searchValue,
2122 optionFilterProp,
2223 filterSort,
2324 onSearch,
2425 autoClearSearchValue,
25- ...( typeof showSearch === 'object' ? showSearch : { } ) ,
26+ ...( isObject ? showSearch : { } ) ,
2627 } ;
2728
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 ] ;
3730 } , [
3831 showSearch ,
3932 filterOption ,
You can’t perform that action at this time.
0 commit comments