🐛[BUG] update `jsx: "react"` into `jsx: "react-jsx"` to suport the new JSX transform in React 17 in tsconfig.json
See original GitHub issue🐛 bug 描述
update `jsx: "react"` into `jsx: "react-jsx"` to suport the new JSX transform in React 17 in tsconfig.json
© 版本信息
- Ant Design Pro 版本: 6.5.16
- umi 版本 3.2.28
- 浏览器环境 Chrome 89
- 开发环境 Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Introducing the New JSX Transform – React Blog
Although React 17 doesn't contain new features, it will provide support for a new version of the JSX transform. In this post, we...
Read more >"react-scripts build" is updating my "jsx":" - Stack Overflow
I just realised what the problem was. I had a package.json file one level up from my actual project. It was there by...
Read more >TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes ... With React 17 the library supports a new form of JSX transformation via a ......
Read more >"jsx": "react-jsx", - Genuitec
Hi all,. Codemix complains about this line is tsconfig.json. “jsx”: “react-jsx”,. Argument for '–jsx' option must be: 'preserve', ...
Read more >API - ESBuild
For example, you can auto-import the react package to provide functions such as React.createElement . See the JSX documentation for details. #Injecting files ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
解决方法:
确保 typescript 的依赖安装完成,随便打开一个提示错误的 .tsx 文件。
macOS 使用 command + shift + p,Windows 貌似是 ctrl + shift + p 。
然后输入 TypeScript ,不出意外的话你会看到 Select Typescript Version 选项。 选择 node_modules 下的那个版本(一般来说都会比较新)。
一般来说就没有问题了。
// tsconfig.json
“compilerOptions”: {
}