Merge pull request #204 from liby/feature/remove-react-fc

chore: remove residual `FC` and `FunctionComponent` from components
This commit is contained in:
DarkSky
2022-08-12 19:52:35 +08:00
committed by GitHub
86 changed files with 97 additions and 121 deletions
@@ -1,9 +1,15 @@
import { type FC, useRef } from 'react';
import { type ComponentType, useRef } from 'react';
import * as uiIcons from '@toeverything/components/icons';
import { message, styled } from '@toeverything/components/ui';
import { copy } from './copy';
const IconBooth = ({ name, Icon }: { name: string; Icon: FC<any> }) => {
const IconBooth = ({
name,
Icon,
}: {
name: string;
Icon: ComponentType<any>;
}) => {
const on_click = () => {
copy(`<${name} />`);
message.success('Copied ~');
@@ -36,7 +42,13 @@ export const Icons = () => {
<hr />
<IconsContainer>
{_icons.map(([key, icon]) => {
return <IconBooth key={key} name={key} Icon={icon as FC} />;
return (
<IconBooth
key={key}
name={key}
Icon={icon as ComponentType<any>}
/>
);
})}
</IconsContainer>
</Container>