react-draft-wysiwyg: Uncaught TypeError: editorState.getImmutable is not a function

I’ve got this error whenever I issued any actions with the editor.

Uncaught TypeError: editorState.getImmutable is not a function
    at Function.set (EditorState.js:78)
    at e.value (react-draft-wysiwyg.js:38)
    at ReactCompositeComponent.js:611
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)
    at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:610)
    at ReactCompositeComponentWrapper.receiveComponent (ReactCompositeComponent.js:547)
    at Object.receiveComponent (ReactReconciler.js:125)
    at Object.updateChildren (ReactChildReconciler.js:109)
    at ReactDOMComponent._reconcilerUpdateChildren (ReactMultiChild.js:208)
    at ReactDOMComponent._updateChildren (ReactMultiChild.js:312)

Code (unnecessary details omitted)

import {Editor} from "react-draft-wysiwyg";
import {EditorState} from "draft-js"

this.state = {
      detail: EditorState.createEmpty(),
};

onDetailChange(value) {
    this.setState({ detail: value });
    this.props.onChange({ ...this.state, detail: value });
 }

<Editor editorState={this.state.detail} onChange={this.onDetailChange.bind(this)} />

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Please use onEditorStateChange instead of onChange. Refer docs: https://jpuri.github.io/react-draft-wysiwyg/#/docs