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
+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} />;