TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.89k stars 381 forks source link

SuggestionMenu , sideMenu #861

Closed Munna5553 closed 1 week ago

Munna5553 commented 1 week ago
Uncaught
TypeError: Cannot read properties of undefined (reading 'SuggestionMenu') at Er () at renderWithHooks () at mountIndeterminateComponent () at beginWork () at beginWork$1 () at performUnitOfWork () at workLoopSync () at renderRootSync () at recoverFromConcurrentError () at performSyncWorkOnRoot ()
  | Show 12 more frames -- | --

Screenshot 2024-06-24 132318

matthewlipski commented 1 week ago

Hi, can you provide more details about this please? Code snippet/sandbox, bundler used, when the error gets thrown, etc?

Munna5553 commented 1 week ago

import { BlockNoteEditor, PartialBlock } from "@blocknote/core"; import { useCreateBlockNote } from "@blocknote/react"; import { BlockNoteView } from "@blocknote/mantine" import "@blocknote/mantine/style.css";

interface editorProps { initialContent?: string; editable?: boolean; }

const TextEditor: React.FC = ({ initialContent, editable }) => {

const editor = useCreateBlockNote({
    initialContent: initialContent ? (JSON.parse(initialContent) as PartialBlock[]) : undefined,
}) as BlockNoteEditor;

return (
    <BlockNoteView
        onChange={() => { console.log(JSON.stringify(editor.domElement.innerHTML)) }}
        editor={editor}
        editable={editable}
        theme={"light"}
    />
)

}

export default TextEditor;

how to get the data where is use/call this component,


please update documentation -> how to implement in typescript this editor is not working in reactjs without import { BlockNoteView } from "@blocknote/mantine" import "@blocknote/mantine/style.css"; but its work with nextjs

please a clear doc which is really helpful us.