Default text
", + // +++ +}); +``` + +### Use initialContent instead + +The `initialContent` option sets a flag internally and only sets the content the +**very first time** the document is empty. This prevents duplication: + +```tsx +// ✅ CORRECT: This only sets content once +import { useEditor } from "@tiptap/react"; +import { useLiveblocksExtension } from "@liveblocks/react-tiptap"; +import StarterKit from "@tiptap/starter-kit"; + +function Editor() { + const liveblocks = useLiveblocksExtension({ + // ✅ This text is only set the first time the room is used + // +++ + initialContent: "Default text
", + // +++ + }); + + const editor = useEditor({ + extensions: [ + StarterKit.configure({ + // Required, Liveblocks extension handles its own history + undoRedo: false, + }), + liveblocks, + ], + }); + + return+ Connecting to canvas{".".repeat(dots)} +
+{message}
+