mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
23 lines
698 B
TypeScript
23 lines
698 B
TypeScript
|
import * as React from 'react';
|
||
|
|
||
|
import { ConfigContext, type RenderEmptyHandler } from '../../config-provider';
|
||
|
|
||
|
export default function useBase(
|
||
|
customizePrefixCls?: string,
|
||
|
direction?: 'ltr' | 'rtl',
|
||
|
): [
|
||
|
prefixCls: string,
|
||
|
cascaderPrefixCls: string,
|
||
|
direction?: 'ltr' | 'rtl',
|
||
|
renderEmpty?: RenderEmptyHandler,
|
||
|
] {
|
||
|
const { getPrefixCls, direction: rootDirection, renderEmpty } = React.useContext(ConfigContext);
|
||
|
|
||
|
const mergedDirection = direction || rootDirection;
|
||
|
|
||
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
||
|
const cascaderPrefixCls = getPrefixCls('cascader', customizePrefixCls);
|
||
|
|
||
|
return [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty];
|
||
|
}
|