> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# useEditor

> **useEditor**(): [`Editor`](/api/editor/type-aliases/editor/)

Defined in: packages/editor/src/editor/use-editor.ts:19

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

## Returns

[`Editor`](/api/editor/type-aliases/editor/)

The current editor object.

## Example

```tsx
import { useEditor } from '@portabletext/editor'

function MyComponent() {
 const editor = useEditor()
}
```