mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +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;
|
|
}
|