Skip to content

Commit

Permalink
Editor instance toJSON should call toJSON method on editor state (fac…
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreatercurve authored Jun 12, 2022
1 parent 0bee1f0 commit c61156f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/lexical/src/LexicalEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import type {EditorState, SerializedEditorState} from './LexicalEditorState';
import type {DOMConversion, LexicalNode, NodeKey} from './LexicalNode';

import {SerializedEditor} from 'lexical';
import getDOMSelection from 'shared/getDOMSelection';
import invariant from 'shared/invariant';
import {Class} from 'utility-types';
Expand Down Expand Up @@ -793,11 +794,9 @@ export class LexicalEditor {
triggerListeners('readonly', this, true, readOnly);
}

toJSON(): {
editorState: EditorState;
} {
toJSON(): SerializedEditor {
return {
editorState: this._editorState,
editorState: this._editorState.toJSON(),
};
}
}

0 comments on commit c61156f

Please sign in to comment.