Open aleafo opened 6 years ago
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.
`
` I suggest the decorator param reserving, or else it may be difficult to decorate the data dynamically.
By this way , the Image in Editor cant`t be edited
Yes. Images could not be edited. If you have any idea ?
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.