Skip to content

Function: useEditor() ​

ts
function useEditor(options): Editor;

Create an editor for the lifetime of the component (or effect scope).

  • content and label are read on creation only; use editor.setContent() later.
  • editable can be a ref or getter and is applied whenever it changes.
  • The editor is destroyed when the scope is disposed (component unmount).

Parameters ​

ParameterType
optionsUseEditorOptions

Returns ​

Editor

Example ​

ts
const editor = useEditor({ extensions, content: props.initial, label: 'Article text' })