Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[v4] Bug: React 17, React is not defined after ejecting #9953
Comments
|
I guess that this issue should be moved to https://github.com/facebook/create-react-app |
|
This is not an issue about create-react-app. Thanks for replying quickly. |
|
I'm having this exact issue even without ejecting. I followed the migration guide, ran react-codemod, deleted node_modules. The compiler says the code compiled successfully but getting the red screen in the browser. |
|
Upgrade React 17 and remove the CRA ejection issue has been fixed in #9885 and needs to wait for the maintainer to publish a new version. :) |
React version: 17.0.1
Steps To Reproduce
Link to code example: https://codesandbox.io/s/ecstatic-wood-ou6px
The current behavior
I upgraded react to 17 and removed "import React"s from my project files (except index.js where react mounted). But I got "ReferenceError: React is not defined" in those files.
To investigate the issue behind this, I created a new react app, the new JSX transformation was working. But when I eject, it throws the same errors.
So;
Without react-scripts, new JSX transformation doesn't working.
The expected behavior
Components should render without declaring React (import React from "react") if React is in scope.