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.

React 17 default to `react-jsx` in tsconfig

See original GitHub issue

With 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jaysoocommented, Apr 1, 2021

@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-8f62961a5b32590af61aaee94cab47b8cf5ca114fbb7bd17a2b1974ebc2c78d3R30

I’ve opened an issue here to capture your eslint rule request. https://github.com/nrwl/nx/issues/5198

2reactions
jaysoocommented, Apr 1, 2021

@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.

Read more comments on GitHub >

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

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