diff --git a/docs/pages/api-reference/liveblocks-react-blocknote.mdx b/docs/pages/api-reference/liveblocks-react-blocknote.mdx index 918ad89b02f..9af1d78dc3a 100644 --- a/docs/pages/api-reference/liveblocks-react-blocknote.mdx +++ b/docs/pages/api-reference/liveblocks-react-blocknote.mdx @@ -1025,31 +1025,33 @@ function Threads({ editor }: { editor: BlockNoteEditor }) { // +++ ``` -Here’s how it can be used in the context of your editor. +### useIsEditorReady + +Used to check if the editor content has been loaded or not, helpful for +displaying a loading skeleton. + +```ts +import { useIsEditorReady } from "@liveblocks/react-blocknote"; + +const status = useIsEditorReady(); +``` + +Here's how it can be used in the context of your editor. ```tsx -import { useLiveblocksExtension } from "@liveblocks/react-tiptap"; -// +++ -import { useIsEditorReady, useEditor, EditorContent } from "@tiptap/react"; -// +++ +import { useCreateBlockNoteWithLiveblocks, useIsEditorReady } from "@liveblocks/react-blocknote"; +import { BlockNoteView } from "@blocknote/mantine"; function TextEditor() { - const liveblocks = useLiveblocksExtension(); + const editor = useCreateBlockNoteWithLiveblocks({}); // +++ const ready = useIsEditorReady(); // +++ - const editor = useEditor({ - extensions: [ - liveblocks, - // ... - ], - }); - return (
// +++ - {!ready ?
Loading...
: } + {!ready ?
Loading...
: } // +++
); diff --git a/docs/pages/api-reference/liveblocks-react-tiptap.mdx b/docs/pages/api-reference/liveblocks-react-tiptap.mdx index 54246a0023a..2b385189a98 100644 --- a/docs/pages/api-reference/liveblocks-react-tiptap.mdx +++ b/docs/pages/api-reference/liveblocks-react-tiptap.mdx @@ -2282,9 +2282,9 @@ const status = useIsEditorReady(); Here’s how it can be used in the context of your editor. ```tsx -import { useLiveblocksExtension } from "@liveblocks/react-tiptap"; // +++ -import { useIsEditorReady, useEditor, EditorContent } from "@tiptap/react"; +import { useIsEditorReady, useLiveblocksExtension } from "@liveblocks/react-tiptap"; +import { useEditor, EditorContent } from "@tiptap/react"; // +++ function TextEditor() {