diff --git a/components/markdown/markdown-widgets.tsx b/components/markdown/markdown-widgets.tsx index 8e3e15e..763b2d1 100644 --- a/components/markdown/markdown-widgets.tsx +++ b/components/markdown/markdown-widgets.tsx @@ -9,7 +9,16 @@ import type { RehypeRewriteOptions } from "rehype-rewrite"; // out of the initial board bundle. Shared here so every place that needs // markdown (group notes, to-do details) uses the exact same editor/preview // widgets instead of each declaring its own dynamic import. -export const MDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false }); +const RawMDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false }); + +// `preview` only seeds the editor's initial mode -- @uiw/react-md-editor +// owns it as internal state after that, flipped by the edit/live/preview +// toolbar buttons. Defaulting it to "preview" opens every editor rendered +// instead of raw markdown, while the toolbar still lets someone drop into +// "edit" (or the split "live" view) when they want granular control. +export function MDEditor(props: ComponentProps) { + return ; +} const RawMarkdownPreview = dynamic( () => import("@uiw/react-md-editor").then((mod) => mod.default.Markdown),