File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,26 +15,21 @@ export default function useSearchConfig(
1515 treeNodeFilterProp,
1616 } = props ;
1717 return React . useMemo < [ boolean | undefined , SearchConfig ] > ( ( ) => {
18- const legacysearchConfig : SearchConfig = {
18+ const searchConfig : SearchConfig = {
1919 searchValue : searchValue ?? inputValue ,
2020 onSearch,
2121 autoClearSearchValue,
2222 filterTreeNode,
2323 treeNodeFilterProp,
24+ ...( typeof showSearch === 'object' ? showSearch : { } ) ,
2425 } ;
25-
26- if ( showSearch === undefined || showSearch === true ) {
27- return [ showSearch as boolean , legacysearchConfig ] ;
28- }
29-
30- if ( ! showSearch ) {
26+ if ( showSearch === false ) {
3127 return [ false , { } ] ;
3228 }
3329
34- const searchConfig = {
35- ...legacysearchConfig ,
36- ...showSearch ,
37- } ;
30+ if ( showSearch === undefined ) {
31+ return [ undefined , searchConfig ] ;
32+ }
3833
3934 return [ true , searchConfig ] ;
4035 } , [
You can’t perform that action at this time.
0 commit comments