Open anynines-johannchopin opened 4 years ago
Hey team 👋
I use convertFromHTML from draft-convert to convert my html string to an object that can be called as parameter from EditorState.createWithContent from draftjs (as explained in the README).
convertFromHTML
draft-convert
EditorState.createWithContent
draftjs
But when I do something like that:
const textToConvert = '<p>A paragraph</p>' editorState = EditorState.createWithContent(convertFromHTML(textToConvert)); ~~~~~~~~~~~~~
I get a type definition error from TypeScript:
Type 'string' has no properties in common with type 'IConvertFromHTMLConfig'
Have I missed something because like that it's working pretty well 🤔
Here is the link of the sandbox
Hey team 👋
I use
convertFromHTML
fromdraft-convert
to convert my html string to an object that can be called as parameter fromEditorState.createWithContent
fromdraftjs
(as explained in the README).But when I do something like that:
I get a type definition error from TypeScript:
Have I missed something because like that it's working pretty well 🤔
Here is the link of the sandbox