react-codemirror2
react-codemirror2 copied to clipboard
TS ERROR
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?
Have you solved the problem? --help
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.
same issue, any suggestion?