question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛[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:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Leskurcommented, Dec 7, 2020

解决方法:

确保 typescript 的依赖安装完成,随便打开一个提示错误的 .tsx 文件。

macOS 使用 command + shift + p,Windows 貌似是 ctrl + shift + p 。

然后输入 TypeScript ,不出意外的话你会看到 Select Typescript Version 选项。 选择 node_modules 下的那个版本(一般来说都会比较新)。

一般来说就没有问题了。

1reaction
james70scommented, Feb 24, 2021

// tsconfig.json

“compilerOptions”: {

"module": "esnext",
"target": "esnext",
"jsx": "react-jsx",    // 改成该配置

}

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found