refactor: remove React.FC for affine core (#3617)

This commit is contained in:
Garfield Lee
2023-08-08 14:54:31 +08:00
committed by GitHub
parent ceeabfeb00
commit 3009d729fa
32 changed files with 314 additions and 242 deletions

View File

@@ -7,7 +7,7 @@ import {
currentWorkspaceIdAtom,
} from '@toeverything/infra/atom';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import type { FC, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { lazy, Suspense, useCallback, useTransition } from 'react';
import type { SettingAtom } from '../atoms';
@@ -52,7 +52,7 @@ const OnboardingModal = lazy(() =>
}))
);
export const Setting: FC = () => {
export const Setting = () => {
const [currentWorkspace] = useCurrentWorkspace();
const [{ open, workspaceId, activeTab }, setOpenSettingModalAtom] =
useAtom(openSettingModalAtom);
@@ -89,6 +89,7 @@ export function CurrentWorkspaceModals() {
const [openDisableCloudAlertModal, setOpenDisableCloudAlertModal] = useAtom(
openDisableCloudAlertModalAtom
);
return (
<>
<Suspense>
@@ -139,6 +140,7 @@ export const AllWorkspaceModals = (): ReactElement => {
},
[setOpenSettingModalAtom, setOpenWorkspacesModal]
);
return (
<>
<Suspense>