react-codemirror2 icon indicating copy to clipboard operation
react-codemirror2 copied to clipboard

TS ERROR

Open iamsongqian opened this issue 4 years ago • 3 comments

MY CODE: import { UnControlled as CodeMirror } from "react-codemirror2"; import "codemirror/lib/codemirror.css"; import "codemirror/lib/codemirror.js"; <CodeMirror />

MY ERROR: JSX element class does not support attributes because it does not have a 'props' property ts(2607) 'CodeMirror' cannot be used as a JSX component. Its instance type 'Controlled' is not a valid JSX element. Type 'Controlled' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.

MY QUESTION: how can i fix this ts error?

iamsongqian avatar Oct 12 '20 07:10 iamsongqian

image Have you solved the problem? --help

Chasen-Zhang avatar Apr 11 '22 12:04 Chasen-Zhang

I had the same issue as @Chasen-Zhang, and fixed it by updating my @types/react version in dev dependencies to the same version as my react dependency. Somehow they got out of sync.

antman888 avatar Dec 20 '22 20:12 antman888

same issue, any suggestion?

superhos avatar Aug 18 '23 06:08 superhos