Problem
How can I change the content of my editor programmatically without causing an onChange. I am trying to update the content of my editor with socket io and I am out of ideas. Apparently in the version of Slate + Editable there is no such thing as value={value} and then onChange(setValue()) soooo...
<Slate editor={editor} initialValue={value} onChange={handleChange}>
<div className="Editor-block">
<Editable
className="text-field"
// for basic functionality
renderElement={renderElement}
renderLeaf={renderLeaf}
// if editor is focused it passes down the element for formating
onFocus={() => {
handleEditorFocus(editor);
}}
// adding shortcuts for formating
onKeyDown={onTextFieldKeyDown}
value={editorValue}
ref
//contentEditable
/>
</div>
</Slate>
Problem How can I change the content of my editor programmatically without causing an onChange. I am trying to update the content of my editor with socket io and I am out of ideas. Apparently in the version of Slate + Editable there is no such thing as value={value} and then onChange(setValue()) soooo...
Context "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", "slate": "^0.94.1", "slate-history": "^0.93.0", "slate-react": "^0.97.2", "socket.io-client": "^4.7.1", "uuid": "^9.0.0"