Closed
Description
Hello BlockNote Team,
I am using BlockNote in one of my nextjs projects. On the left panel of the page, I have a list of notes and on the right panel, there is Editor. When I click a note title on the left panel, it fetches the content from an API and passes the content to the right panel Editor. But, I got an error when I navigate to a previously selected note. Can you please help me to fix this issue?
I have attached a screenshot, a video and the code of BlockNote component I have used in my project.
block_note_error.mp4
import { type Block, type PartialBlock } from '@blocknote/core';
import '@blocknote/core/fonts/inter.css';
import { BlockNoteView } from '@blocknote/mantine';
import '@blocknote/mantine/style.css';
import { useCreateBlockNote } from '@blocknote/react';
export type BlockNoteEditorProps = {
initialContent: PartialBlock[];
handleChange: (content: Block[]) => void;
};
export const BlockNoteEditor = ({ initialContent, handleChange }: BlockNoteEditorProps): React.ReactNode => {
const editor = useCreateBlockNote(
{
initialContent,
},
[initialContent],
);
return (
<div>
<BlockNoteView
editor={editor}
onChange={() => {
handleChange(editor.document);
}}
/>
</div>
);
};
export default BlockNoteEditor;
Metadata
Metadata
Assignees
Labels
No labels