From 8fdcd5b57f833d593f0e12403849eb69411edaf6 Mon Sep 17 00:00:00 2001 From: choidabom Date: Sat, 24 Aug 2024 22:11:17 +0900 Subject: [PATCH] Add lazy loading for UserPresenceList --- frontend/src/components/headers/DocumentHeader.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/headers/DocumentHeader.tsx b/frontend/src/components/headers/DocumentHeader.tsx index 75f014b4..1a18cd88 100644 --- a/frontend/src/components/headers/DocumentHeader.tsx +++ b/frontend/src/components/headers/DocumentHeader.tsx @@ -12,7 +12,7 @@ import { Toolbar, Tooltip, } from "@mui/material"; -import { useEffect } from "react"; +import { lazy, useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; import { useUserPresence } from "../../hooks/useUserPresence"; @@ -21,7 +21,8 @@ import { selectWorkspace } from "../../store/workspaceSlice"; import DownloadMenu from "../common/DownloadMenu"; import ShareButton from "../common/ShareButton"; import ThemeButton from "../common/ThemeButton"; -import UserPresenceList from "./UserPresenceList"; + +const UserPresenceList = lazy(() => import("./UserPresenceList")); function DocumentHeader() { const dispatch = useDispatch();