这个错误是 TypeScript 编译器提示的。
解决办法
在 tsconfig 文件中配置 jsx: react-jsx
即可
{
"compilerOptions": {
// ...
"jsx": "react-jsx", // 编译后用 React.cloneElement 方法代替 jsx
},
}
更多推荐
见鬼,TSC 编译 TS 文件出现了‘React‘ refers to a UMD global, but the current file is a modu
发布评论