Skip to content

useEditor

useEditor(): Editor

Defined in: packages/editor/src/editor/editor-provider.tsx:97

Get the current editor context from the EditorProvider. Must be used inside the EditorProvider component.

Returns

Editor

The current editor object.

Example

import { useEditor } from '@portabletext/editor'
function MyComponent() {
const editor = useEditor()
}