React 17 default to `react-jsx` in tsconfig
See original GitHub issueWith react 17 the import of React is not required to use jsx, but this is only possible if we got
"compilerOptions": {
"jsx": "react-jsx",
}
in the tsconfig.json file.
Can the @nrwl/react
generator check the version of react in package.json and if its >= 17.0.0 then set that in tsconfig?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Introducing the New JSX Transform – React Blog
Starting from Babel 8, "automatic" will be the default runtime for both plugins. For more information, check out the Babel documentation for @ ......
Read more >TSConfig Option: jsxImportSource - TypeScript
With React 17 the library supports a new form of JSX transformation via a separate import. For example with this code: tsx. import...
Read more >React 17 JSX, react-scripts with TypeScript
With new React 17 offers JSX, it's mean no longer needs to import React on ... import React from "react"; export default function...
Read more >Problem with Visual Studio Code using "react-jsx" as jsx value ...
I'm using the latest version of Typescript, and I updated all my packages with ncu , closed/opened VSCode (works sometimes with tsconfig !)...
Read more >React - Parcel
You'll also need to set the jsxImportSource option in a tsconfig.json or jsconfig.json so that Emotion's JSX pragma is used instead of the...
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 Free
Top 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
@cyrus-za Thanks for the pointers. We have turned the two eslint rules off in our
eslint-plugin-nx
rules. See: https://github.com/nrwl/nx/pull/5131/files#diff-8f62961a5b32590af61aaee94cab47b8cf5ca114fbb7bd17a2b1974ebc2c78d3R30I’ve opened an issue here to capture your eslint rule request. https://github.com/nrwl/nx/issues/5198
@puku0x Emotion migration has been added https://github.com/nrwl/nx/pull/5131/files#diff-a477196d7726c04ca7eb1ec5b8dd71c4fe6d1f12e13515c9f040851456e2d744R1
New apps/libs will also generate with
@emotion/babel-plugin
instead of@emotion/babel-preset-css-prop
.