Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Fixes editor error Cannot read property 'editorState' of undefined at initial loading, when mention prop is used #944

Merged
merged 1 commit into from
Apr 19, 2020

Conversation

luispeerez
Copy link
Contributor

@luispeerez luispeerez commented Mar 16, 2020

When the mention prop is used, while mounting the editor, the library breaks the app sends this message: "Cannot read property editorState of undefined", this is fixed by evaluating if this.state is defined first at getEditorState in src/Editor/index.js

Based in @git9am response in issue #922 (comment)

Fixes: #922

Solves this error:

TypeError: Cannot read property 'editorState' of undefined
a.getEditorState
node_modules/react-draft-wysiwyg/dist/react-draft-wysiwyg.js:7

When the mention prop is used, while mounting the editor, the library breaks the app sending this message: "Cannot read property editorState of undefined", this is fixed by evaluating if this.state is defined first at getEditorState in src/Editor/index.js

Resolves: jpuri#922
@luispeerez luispeerez changed the title [fix] Fixes editor at initial loading, when mention prop is used [FIX] Fixes editor error Cannot read property 'editorState' of undefined at initial loading, when mention prop is used Mar 16, 2020
@jpuri jpuri merged commit 4d0aaf6 into jpuri:master Apr 19, 2020
@jpuri
Copy link
Owner

jpuri commented Apr 19, 2020

react-draft-wysiwyg@1.14.5 has the fix.

@luispeerez
Copy link
Contributor Author

react-draft-wysiwyg@1.14.5 has the fix.

Thank you @jpuri 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using mention breaks the app
2 participants