mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
refactor: remove next/dynamic (#1901)
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user