react-editor-js
react-editor-js copied to clipboard
Can't set value by value prop
Environment
- react-editor-js version:2.24.3
Describe
When setting value editor throws an error => this._editorJS.render is not a function at ClientEditorCore.<anonymous>
I also tried added via data prop but the value is not passing by that either.
<ReactEditorJS
tools={EDITOR_JS_TOOLS}
readOnly={isReadOnly}
onInitialize={handleInitialize}
enableReInitialize
value={editorCore.current ? content : null}
/>
Environment
- react-editor-js version:2.24.3
Describe
When setting value editor throws an error =>
this._editorJS.render is not a function at ClientEditorCore.<anonymous>
I also tried added via data prop but the value is not passing by that either.
<ReactEditorJS tools={EDITOR_JS_TOOLS} readOnly={isReadOnly} onInitialize={handleInitialize} enableReInitialize value={editorCore.current ? content : null} />
having the same problem. I am unable to update the value once the props are updated
adding yield this._editorJS.isReady;
before calling render has solved the issue π
a possible fix maybe? @Jungwoo-An
render(data) {
return __awaiter(this, void 0, void 0, function* () {
yield this._editorJS.isReady;
yield this._editorJS.render(data);
});
}
adding
yield this._editorJS.isReady;
before calling render has solved the issue π a possible fix maybe? @Jungwoo-Anrender(data) { return __awaiter(this, void 0, void 0, function* () { yield this._editorJS.isReady; yield this._editorJS.render(data); }); }
Was able to update the value with your fix:
const updateValue = (data) => {
editorCore.current._editorJS.isReady.then(() => {
editorCore.current._editorJS.render(data);
});
}
@Jungwoo-An Hi! Do you have time to check this? We need this to make things work :(
Any updates on the fix please ? do you have a release date for it ? thanks
+1
Anyone fixed this?