verbum icon indicating copy to clipboard operation
verbum copied to clipboard

Lexical.dev.js:9060 Uncaught Error: Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().

Open lwelcom opened this issue 1 year ago • 2 comments

Describe the bug "verbum": "^0.5.0",

  1. Unable to initialize default value
  2. onChange cannot be converted into html code

const onChange = (state: string, editor?: any) => { console.log(state, editor, "-----------------------editor");

editor?.update(() => { const editorState = editor.getEditorState(); console.log(editorState, "-------------------------editorState");

const jsonString = JSON.stringify(editorState);
console.log(jsonString, '-------------------------jsonString');

const htmlString = $generateHtmlFromNodes(editor, null);
console.log(htmlString, '-------------------------htmlString');

})

lwelcom avatar Oct 18 '23 07:10 lwelcom

I have the same problem, please help me

HoaPhamThi avatar Dec 21 '23 15:12 HoaPhamThi

Same here.

henryobiaraije avatar Jul 13 '24 14:07 henryobiaraije