remirror/remirror

View on GitHub
packages/remirror__react-core/src/hooks/use-editor-state.ts

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
import { EditorState } from '@remirror/pm/state';

import { useRemirrorContext } from './use-remirror-context';

/**
 * A core hook which provides the latest editor state every time that it
 * updates.
 */
export function useEditorState(): EditorState {
  return useRemirrorContext({ autoUpdate: true }).getState();
}