Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors with plain CRA project (version 4.0.0 and React version 17.0.1) #73

Open
valstu opened this issue Nov 12, 2020 · 5 comments

Comments

@valstu
Copy link
Contributor

valstu commented Nov 12, 2020

Getting this error when creating a new project with CRA (javascript) and starting it:

image

Most likely related to these new features React 17 provided:

Because the new JSX transform will automatically import the necessary react/jsx-runtime functions, React will no longer need to be in scope when you use JSX. This might lead to unused React imports in your code.

@valstu valstu changed the title Doesn't work with CRA version 4.0.0 and React version 17.0.1 Compile errors with plain CRA project (version 4.0.0 and React version 17.0.1) Nov 12, 2020
@petetnt
Copy link
Member

petetnt commented Nov 12, 2020

Add

    "rules": {
      "react/jsx-uses-react": "off",
      "react/react-in-jsx-scope": "off"
    }

to your eslintrc for now

@valstu
Copy link
Contributor Author

valstu commented Nov 12, 2020

Yeah, did that 👍 Just added this as a reminder here.

@petetnt
Copy link
Member

petetnt commented Nov 12, 2020

Not sure where those come from though, they should be off by default in CRA 4.0.0.

@petetnt
Copy link
Member

petetnt commented Nov 12, 2020

@petetnt
Copy link
Member

petetnt commented Nov 12, 2020

Filed upstream: airbnb/javascript#2334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants