The editor is starting as if it has empty string!
I tried this:
EditorState.createWithContent(ContentState.createFromText('Hello'))
and this:
const html = '<p>Hey this <strong>editor</strong> rocks 😀</p>';
const contentBlock = htmlToDraft(html);
if (contentBlock) {
const contentState = ContentState.createFromBlockArray(contentBlock.contentBlocks);
const editorState = EditorState.createWithContent(contentState);
this.state = {
editorState,
};
}
and this:
import htmlToDraft from 'html-to-draftjs'
htmlToDraft(text)
nothing worked!