React 17 CRA with new JSX transform before the official v4
See original GitHub issueIf you install a new CRA and you don’t want to import React in each file right now these are the steps you need to do:
- delete the node_modules folder
- delete package-lock.json
- replace the existing react-scripts with “react-scripts”: “4.0.0-next.98” in package.json
- Replace esLintConfig with (in package.json):
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
],
"rules": {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
},
- create an .env file and add SKIP_PREFLIGHT_CHECK=true in it
- npm install
This is the workaround for now. Until the final v4 of CRA gets available this is what you have to do.🤠
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Introducing the New JSX Transform – React Blog
Together with the React 17 release, we've wanted to make a few improvements to the JSX transform, but we didn't want to break...
Read more >React 17 introduces new JSX transform - Saeloun Blog
A Babel plugin called @babel/plugin-transform-react-jsx transforms JSX into standard JavaScript objects that a JavaScript engine can parse.
Read more >Upgrade Create React App-Based Projects to Version 4 (CRA 4)
In this article, we'll use Create React App 4 (CRA 4) as an example to walk through the ... With the new transform,...
Read more >React 17: New Features!! - JSX Transform is Amazing!!
Become A VS Code SuperHero Today: http://vsCodeHero.comAbout a month ago React 17 was announced and it seemed to be a very underwhelming ...
Read more >React 17: New JSX Transform - In Plain English
The new JSX transform, however, no longer requires the React import. The compilation will still work without a single change to your JSX...
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
The new version of Create React App hasn’t been released yet but this has already been implemented. When v4 is released this will work without you needing to do anything.
Did you do step 4?