mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
084f234bc9
* 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 test
12 lines
381 B
TypeScript
12 lines
381 B
TypeScript
import type { ReactNode } from 'react';
|
|
|
|
/**
|
|
* Since Select, TreeSelect, Cascader is same Select like component.
|
|
* We just use same hook to handle this logic.
|
|
*
|
|
* If `suffixIcon` is not equal to `null`, always show it.
|
|
*/
|
|
export default function useShowArrow(suffixIcon?: ReactNode, showArrow?: boolean) {
|
|
return showArrow !== undefined ? showArrow : suffixIcon !== null;
|
|
}
|