Browse Source
* refactor: remove showArrow prop * fix: optimize iconUtil * refactor: refactor tree-select&cascader * docs: update api docs * test: add test * fix: update warning * chore: update dep version * test: update testfeature
MuxinFeng
1 year ago
committed by
GitHub
16 changed files with 112 additions and 41 deletions
@ -1,9 +1,11 @@ |
|||
import type { ReactNode } from 'react'; |
|||
|
|||
/** |
|||
* Since Select, TreeSelect, Cascader is same Select like component. |
|||
* We just use same hook to handle this logic. |
|||
* |
|||
* If `showArrow` not configured, always show it. |
|||
* If `suffixIcon` is not equal to `null`, always show it. |
|||
*/ |
|||
export default function useShowArrow(showArrow?: boolean) { |
|||
return showArrow ?? true; |
|||
export default function useShowArrow(suffixIcon?: ReactNode, showArrow?: boolean) { |
|||
return showArrow !== undefined ? showArrow : suffixIcon !== null; |
|||
} |
|||
|
Loading…
Reference in new issue