UNPKG

@blocknote/react

Version:

A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.

13 lines (12 loc) 714 B
import type { BlockNoteEditor } from "@blocknote/core"; /** * Subscribes to editor content changes. The callback is invoked whenever the * editor's document is modified, and the subscription is automatically cleaned * up when the component unmounts. The latest `callback` is always the one * invoked — passing a new callback identity does not resubscribe. * * @param callback - Function called when the editor content changes. * @param editor - The BlockNote editor instance. If omitted, uses the editor * from the nearest `BlockNoteContext`. */ export declare function useEditorChange(callback: Parameters<BlockNoteEditor<any, any, any>["onChange"]>[0], editor?: BlockNoteEditor<any, any, any>): void;