jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.38k stars 1.16k forks source link

Type error: 'Editor' cannot be used as a JSX component. #1433

Open DobromirKirovLime opened 2 months ago

DobromirKirovLime commented 2 months ago

My package.json.

    "next": "^14.0.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "@types/react": "18.2.6",
    "@types/react-dom": "18.2.4",
    "react-draft-wysiwyg": "^1.15.0",

That is the error.

Type error: 'Editor' cannot be used as a JSX component.
  Its element type 'Component<EditorProps, any, any> | ReactElement<any, any> | null' is not a valid JSX element.
    Type 'Component<EditorProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<EditorProps, any, any>' is not assignable to type 'ElementClass'.
        The types returned by 'render()' are incompatible between these types.
          Type 'React.ReactNode' is not assignable to type 'import("/Users/dobromirkirov/Documents/Work/Projects/the-common-ground/the-common-ground-platform/node_modules/@types/react-dom/node_modules/@types/react/ts5.0/index").ReactNode'.
            Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
              Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.