Function: useEditor()
ts
function useEditor(options): Editor;Create an editor for the lifetime of the component (or effect scope).
contentandlabelare read on creation only; useeditor.setContent()later.editablecan be a ref or getter and is applied whenever it changes.- The editor is destroyed when the scope is disposed (component unmount).
Parameters
| Parameter | Type |
|---|---|
options | UseEditorOptions |
Returns
Example
ts
const editor = useEditor({ extensions, content: props.initial, label: 'Article text' })