chore: remove residual FC and FunctionComponent from components

This commit is contained in:
Bryan Lee
2022-08-12 10:56:22 +08:00
parent d3b4906da9
commit 495d9ccc0c
88 changed files with 99 additions and 123 deletions
@@ -1,5 +1,4 @@
import type {
FC,
MouseEventHandler,
CSSProperties,
PropsWithChildren,
+1 -1
View File
@@ -41,7 +41,7 @@ type ListButtonProps = {
content?: string;
children?: () => JSX.Element;
hover?: boolean;
icon?: React.FC<SvgIconProps>;
icon?: (prop: SvgIconProps) => JSX.Element;
};
export const ListButton = (props: ListButtonProps) => {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { FC, ReactNode, CSSProperties } from 'react';
import type { ReactNode, CSSProperties } from 'react';
import { styled } from '../styled';
import { MuiDivider } from '../mui';
import type { MuiDividerProps } from '../mui';
+1 -1
View File
@@ -1,4 +1,4 @@
import type { FC, PropsWithChildren, CSSProperties } from 'react';
import type { PropsWithChildren, CSSProperties } from 'react';
import { Clickable } from '../clickable';
import { styled } from '../styled';
+1 -1
View File
@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { styled } from '../styled';
import type { FC, CSSProperties, ChangeEvent } from 'react';
import type { CSSProperties, ChangeEvent } from 'react';
/**
* WARNING: This component is about to be deprecated, use Select replace
-1
View File
@@ -1,4 +1,3 @@
import type { FC } from 'react';
import { SliderUnstyled, sliderUnstyledClasses } from '@mui/base';
import type { SliderUnstyledProps } from '@mui/base';
import { alpha } from '@mui/system';
-1
View File
@@ -1,5 +1,4 @@
import type {
FC,
ChangeEventHandler,
PropsWithChildren,
CSSProperties,
+3 -3
View File
@@ -1,4 +1,4 @@
import type { FC, PropsWithChildren, ReactNode } from 'react';
import type { PropsWithChildren, ReactNode } from 'react';
// eslint-disable-next-line no-restricted-imports
import {
createTheme,
@@ -30,8 +30,8 @@ export const ThemeProvider = ({ children }: { children?: ReactNode }) => {
export const useTheme = () => muiUseTheme();
export const withTheme = <T,>(
Component: FC<T & { theme: MuiTheme }>
): FC<T> => {
Component: (prop: T & { theme: MuiTheme }) => JSX.Element
): ((prop: T) => JSX.Element) => {
return props => {
const theme = useTheme();
return <Component {...props} theme={theme} />;