React Wysiwyg editor actions stop working with umi js (React v17)

76 views Asked by At

I have been working with react-draft-wysiwyg in umi js framework alongside React version 17. The problem I am facing is some of the actions are not working like in my case font size(dropdown), font weight (dropdown), hyper link, etc.

Here is the code,

<Editor
   wrapperClassName="editor-wrapper"
   toolbarClassName="toolbar-wrapper"
   editorClassName="text-editor-wrapper"
   editorState={editorState}
   onEditorStateChange={onEditorStateChange}
   toolbar={{
       options: [
       'inline',
       'fontFamily',
       'blockType',
       'fontSize',
       'textAlign',
       'list',
       'link',
       'colorPicker',
       'history',
    ],
    list: {
        options: ['unordered', 'ordered'],
    },
   }}
   toolbarCustomButtons={[
       <ViewCode
           toggleEditorCode={toggleEditorCode}
           showCode={showCode}
        />,
   ]}
/>

The reason for mentioning versions and everything is because I have seen some already similar problems reported and 2 solutions I have found till now,

  1. "reduce version from 18 to 17"
  2. "remove strict mode".

But I don't have both of these things version is already 17 and strict mode is off. And the strange thing is this was working fine earlier just stopped working some time ago and I am struggling with finding the solution but I want you guys to please look into it as well. Any sort of help will be highly appreciated.

Looking forward towards solutions from innovators.

0

There are 0 answers