Skip to content

Can't set value by value prop #200

Open
@pisacode

Description

@pisacode

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}
      />

Activity

milosglickon

milosglickon commented on Jun 21, 2022

@milosglickon

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

idontreallywolf

idontreallywolf commented on Jul 5, 2022

@idontreallywolf

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);
    });
}
EthanL06

EthanL06 commented on Dec 27, 2022

@EthanL06

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);
    });
}

Was able to update the value with your fix:

const updateValue = (data) => {
  editorCore.current._editorJS.isReady.then(() => {
      editorCore.current._editorJS.render(data);
  });
}
maxkusnetsov

maxkusnetsov commented on Jan 20, 2023

@maxkusnetsov

@Jungwoo-An Hi! Do you have time to check this? We need this to make things work :(

MaherAzzabi

MaherAzzabi commented on Feb 15, 2023

@MaherAzzabi

Any updates on the fix please ? do you have a release date for it ? thanks

orbachar

orbachar commented on Mar 23, 2023

@orbachar

+1

SwapnilSoni1999

SwapnilSoni1999 commented on Jul 13, 2023

@SwapnilSoni1999

Anyone fixed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @MaherAzzabi@pisacode@idontreallywolf@EthanL06@milosglickon

      Issue actions

        Can't set value by value prop · Issue #200 · Jungwoo-An/react-editor-js