mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor: remove next/dynamic (#1901)
This commit is contained in:
@@ -7,11 +7,10 @@ import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||
import { assertExists, nanoid } from '@blocksuite/store';
|
||||
import { NoSsr } from '@mui/material';
|
||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
||||
import dynamic from 'next/dynamic';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import type { FC, PropsWithChildren } from 'react';
|
||||
import { Suspense, useCallback, useEffect } from 'react';
|
||||
import { lazy, Suspense, useCallback, useEffect } from 'react';
|
||||
|
||||
import {
|
||||
currentWorkspaceIdAtom,
|
||||
@@ -57,8 +56,10 @@ declare global {
|
||||
var currentWorkspace: AllWorkspace;
|
||||
}
|
||||
|
||||
const QuickSearchModal = dynamic(
|
||||
() => import('../components/pure/quick-search-modal')
|
||||
const QuickSearchModal = lazy(() =>
|
||||
import('../components/pure/quick-search-modal').then(module => ({
|
||||
default: module.QuickSearchModal,
|
||||
}))
|
||||
);
|
||||
|
||||
export const PublicQuickSearch: FC = () => {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { ListSkeleton } from '@affine/component';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useAtom } from 'jotai';
|
||||
import dynamic from 'next/dynamic';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import type React from 'react';
|
||||
import { Suspense } from 'react';
|
||||
import { lazy, Suspense } from 'react';
|
||||
|
||||
import { openQuickSearchModalAtom } from '../atoms';
|
||||
import {
|
||||
@@ -16,8 +15,10 @@ import { StyledTableContainer } from '../components/blocksuite/block-suite-page-
|
||||
import { useRouterTitle } from '../hooks/use-router-title';
|
||||
import { MainContainer, StyledPage } from './styles';
|
||||
|
||||
const QuickSearchModal = dynamic(
|
||||
() => import('../components/pure/quick-search-modal')
|
||||
const QuickSearchModal = lazy(() =>
|
||||
import('../components/pure/quick-search-modal').then(module => ({
|
||||
default: module.QuickSearchModal,
|
||||
}))
|
||||
);
|
||||
|
||||
export const PublicQuickSearch: React.FC = () => {
|
||||
|
||||
Reference in New Issue
Block a user