mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 00:08:27 +08:00
4dbb0075bb
* docs: split shardProps * chore: update english * chore: update style * chore: update snap
16 lines
340 B
TypeScript
16 lines
340 B
TypeScript
import * as React from 'react';
|
|
import * as all from 'antd';
|
|
|
|
interface AntdProps {
|
|
component: keyof typeof all;
|
|
}
|
|
|
|
function Antd(props: AntdProps) {
|
|
const { component, ...restProps } = props;
|
|
const Component = (all[component] ?? React.Fragment) as React.ComponentType;
|
|
|
|
return <Component {...restProps} />;
|
|
}
|
|
|
|
export default Antd;
|