mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
chore(type): improve TS type definition (#49602)
This commit is contained in:
parent
9ce5cbcf64
commit
a15fcfa1dc
@ -4,8 +4,17 @@ import type { ConfigConsumerProps } from '.';
|
||||
import { ConfigContext } from '.';
|
||||
import Empty from '../empty';
|
||||
|
||||
type ComponentName =
|
||||
| 'Table'
|
||||
| 'List'
|
||||
| 'Select'
|
||||
| 'TreeSelect'
|
||||
| 'Cascader'
|
||||
| 'Transfer'
|
||||
| 'Mentions';
|
||||
|
||||
interface EmptyProps {
|
||||
componentName?: string;
|
||||
componentName?: ComponentName;
|
||||
}
|
||||
|
||||
const DefaultRenderEmpty: React.FC<EmptyProps> = (props) => {
|
||||
@ -29,6 +38,6 @@ const DefaultRenderEmpty: React.FC<EmptyProps> = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
export type RenderEmptyHandler = (componentName?: string) => React.ReactNode;
|
||||
export type RenderEmptyHandler = (componentName?: ComponentName) => React.ReactNode;
|
||||
|
||||
export default DefaultRenderEmpty;
|
||||
|
Loading…
Reference in New Issue
Block a user