import React from "react"; import { useEditor, EditorContent } from "@tiptap/react"; import StarterKit from "@tiptap/starter-kit"; import Collaboration from "@tiptap/extension-collaboration"; import CollaborationCursor from "@tiptap/extension-collaboration-cursor"; function EditorWithOptions(props: any) { const MenuBar = ({ editor }: any) => { if (!editor) { return null; } return ( <> ); }; const editor = useEditor({ extensions: [ StarterKit.configure({ // The Collaboration extension comes with its own history handling history: false, }), // Register the document with Tiptap Collaboration.configure({ document: props.ydoc, }), // Register the collaboration cursor extension CollaborationCursor.configure({ provider: props.provider, user: { name: "Cyndi Lauper", color: "#f783ac", }, }), ], content: "

Hello World!

", }); console.log(props.ydoc); return (
); } export default EditorWithOptions;