File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -155,12 +155,10 @@ to be in the component tree.
155155
156156``` tsx
157157// src/MyComponent.tsx
158- import { useTipTapSync } from " @convex-dev/prosemirror-sync" ;
158+ import { useTipTapSync } from " @convex-dev/prosemirror-sync/tiptap " ;
159159import { EditorContent , EditorProvider } from " @tiptap/react" ;
160160import StarterKit from " @tiptap/starter-kit" ;
161-
162- const extensions = [StarterKit ];
163- const EMPTY_DOC: JSONContent = { type: " doc" , content: [] };
161+ import { api } from " ../convex/_generated/api" ;
164162
165163function MyComponent() {
166164 const sync = useTipTapSync (api .example , " some-id" );
@@ -169,12 +167,14 @@ function MyComponent() {
169167 ) : sync .initialContent !== null ? (
170168 <EditorProvider
171169 content = { sync .initialContent }
172- extensions = { [... extensions , sync .extension ]}
170+ extensions = { [StarterKit , sync .extension ]}
173171 >
174172 <EditorContent editor = { null } />
175173 </EditorProvider >
176174 ) : (
177- <button onClick = { () => sync .create (EMPTY_DOC )} >Create document</button >
175+ <button onClick = { () => sync .create ({ type: " doc" , content: [] })} >
176+ Create document
177+ </button >
178178 );
179179}
180180```
You can’t perform that action at this time.
0 commit comments