File size: 340 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;