You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to edit the html content made by other rich editor ( not by draft ), so the import htmlToDraft from 'html-to-draftjs' is unavailable, or else it will throw fatal error in some conditions.
But the decorator is unavailable when use the component Editor from react-draft-wysiwyg.
http://runjs.cn/code/8wgkxjp1
Just like above, it's all be ok for the decorator while using the component Editor form react-draft.
So, it must be something wrong with this plugin.
The text was updated successfully, but these errors were encountered:
I found the answer by review the source code.
The decorator should be an array like this: const decorator = [ { strategy: findImageEntities, component: Image, }, ];
And then pass it to the Editor prop. <Editor customDecorators={decorator} />
I suggest the decorator param reserving, or else it may be difficult to decorate the data dynamically.
I was trying to edit the html content made by other rich editor ( not by draft ), so the import htmlToDraft from 'html-to-draftjs' is unavailable, or else it will throw fatal error in some conditions.
But the decorator is unavailable when use the component Editor from react-draft-wysiwyg.
http://runjs.cn/code/8wgkxjp1
Just like above, it's all be ok for the decorator while using the component Editor form react-draft.
So, it must be something wrong with this plugin.
The text was updated successfully, but these errors were encountered: