Skip to content

Commit

Permalink
refactor: Optimize Editor component import for EditorMenus
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Mar 1, 2025
1 parent 6d8b5c0 commit 3436a0f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions apps/web/src/components/Composer/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { defineEditorExtension } from "@helpers/prosekit/extension";
import { htmlFromMarkdown } from "@helpers/prosekit/markdown";
import getAvatar from "@hey/helpers/getAvatar";
import { Image } from "@hey/ui";
import dynamic from "next/dynamic";
import "prosekit/basic/style.css";
import { createEditor } from "prosekit/core";
import { ProseKit } from "prosekit/react";
Expand All @@ -14,9 +13,7 @@ import { usePaste } from "src/hooks/prosekit/usePaste";
import { usePostStore } from "src/store/non-persisted/post/usePostStore";
import { useAccountStore } from "src/store/persisted/useAccountStore";
import { useEditorHandle } from "./EditorHandle";

// Lazy load EditorMenus to reduce bundle size
const EditorMenus = dynamic(() => import("./EditorMenus"), { ssr: false });
import EditorMenus from "./EditorMenus";

const Editor: FC = () => {
const { currentAccount } = useAccountStore();
Expand Down

0 comments on commit 3436a0f

Please sign in to comment.