Circle V2 API Docs
    Preparing search index...

    Function useEditorState

    • This hook allows you to watch for changes on the editor instance. It will allow you to select a part of the editor state and re-render the component when it changes.

      Type Parameters

      • TSelectorResult

      Parameters

      Returns TSelectorResult

      const editor = useEditor({...options})
      const { currentSelection } = useEditorState({
      editor,
      selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),
    • This hook allows you to watch for changes on the editor instance. It will allow you to select a part of the editor state and re-render the component when it changes.

      Type Parameters

      • TSelectorResult

      Parameters

      Returns TSelectorResult | null

      const editor = useEditor({...options})
      const { currentSelection } = useEditorState({
      editor,
      selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),