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

Cannot read properties of undefined (reading 'createWithContent') #128

Open
Oyyou opened this issue Sep 19, 2022 · 0 comments
Open

Cannot read properties of undefined (reading 'createWithContent') #128

Oyyou opened this issue Sep 19, 2022 · 0 comments

Comments

@Oyyou
Copy link

Oyyou commented Sep 19, 2022

Running this code

const html = "<p></p>";
const contentBlock = htmlToDraft(html);
const { contentBlocks, entityMap } = contentBlock;
const contentState = ContentState.createFromBlockArray(contentBlocks, entityMap);
const editorState = EditorState.createWithContent(contentState);

And getting this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'createWithContent')
at TextBoxComponent.tsx:88:1
at commitHookEffectListMount (react-dom.development.js:23150:1)
at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
at commitPassiveMountEffects (react-dom.development.js:24866:1)
at flushPassiveEffectsImpl (react-dom.development.js:27039:1)
at flushPassiveEffects (react-dom.development.js:26984:1)
at react-dom.development.js:26769:1
at workLoop (scheduler.development.js:266:1)

I've Googled it a bit, and came across a couple of times it was mentioned, but no concrete solution:
here
and here

Packages:

The code is as basic as it could be - so I'm not sure what the issue could be!

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

No branches or pull requests

1 participant