refactor: remove next/dynamic (#1901)

This commit is contained in:
Himself65
2023-04-12 11:08:50 -05:00
committed by GitHub
parent d9c4fc3a9e
commit 8bcef957fc
8 changed files with 43 additions and 52 deletions
+5 -6
View File
@@ -1,16 +1,15 @@
import { NoSsr } from '@mui/material';
import dynamic from 'next/dynamic';
import { useRouter } from 'next/router';
import { lazy } from 'react';
import { StyledPage, StyledWrapper } from '../../layouts/styles';
import type { NextPageWithLayout } from '../../shared';
import { initPage } from '../../utils/blocksuite';
const Editor = dynamic(
() => import('../../components/__debug__/client/Editor'),
{
ssr: false,
}
const Editor = lazy(() =>
import('../../components/__debug__/client/Editor').then(module => ({
default: module.default,
}))
);
const InitPagePage: NextPageWithLayout = () => {
+3 -5
View File
@@ -11,14 +11,12 @@ import {
} from '@affine/workspace/affine/login';
import { useAtom } from 'jotai';
import type { NextPage } from 'next';
import dynamic from 'next/dynamic';
import { useMemo } from 'react';
import { lazy, useMemo } from 'react';
import { toast } from '../../utils';
const Viewer = dynamic(
() => import('@rich-data/viewer').then(m => ({ default: m.JsonViewer })),
{ ssr: false }
const Viewer = lazy(() =>
import('@rich-data/viewer').then(m => ({ default: m.JsonViewer }))
);
import { useTheme } from 'next-themes';