Closed hihuangwei closed 3 years ago
vsocde 还没准备好,等vscode 准备好了就可以修改默认配置了
请问这个怎么解决的
先忽略 等vscode发版本
解决方法:
确保 typescript 的依赖安装完成,随便打开一个提示错误的 .tsx 文件。
macOS 使用 command + shift + p,Windows 貌似是 ctrl + shift + p 。
然后输入 TypeScript ,不出意外的话你会看到 Select Typescript Version 选项。 选择 node_modules 下的那个版本(一般来说都会比较新)。
一般来说就没有问题了。
// tsconfig.json
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"jsx": "react-jsx", // 改成该配置
}
🐛 bug 描述
update `jsx: "react"` into `jsx: "react-jsx"` to suport the new JSX transform in React 17 in tsconfig.json
© 版本信息