
见鬼,TSC 编译 TS 文件出现了‘React‘ refers to a UMD global, but the current file is a module. Consider adding
这个错误是 TypeScript 编译器提示的。
解决办法在 TSconfig 文件中配置 jsx: React-jsx 即可
{ "compilerOptions": { // ... "jsx": "react-jsx", // 编译后用 React.cloneElement 方法代替 jsx }, }👁️ 阅读量:0
© 版权声明:本文《见鬼,TSC 编译 TS 文件出现了‘React‘ refers to a UMD global, but the current file is a module. Consider adding》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686556863a291259.html。