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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: Argument of type 'htmlConverter' is not assignable to parameter of type 'ContentState'. #173

Open
anynines-johannchopin opened this issue Jul 13, 2020 · 0 comments

Comments

@anynines-johannchopin
Copy link

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).

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

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