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

TSX files needs to have a React import #204

Closed
samuelcastro opened this issue Nov 19, 2020 · 4 comments
Closed

TSX files needs to have a React import #204

samuelcastro opened this issue Nov 19, 2020 · 4 comments

Comments

@samuelcastro
Copy link
Contributor

samuelcastro commented Nov 19, 2020

A few files are not importing React, the one I noticed was: MultiversalGlobalStyles

(JSX attribute) GlobalProps<any>.styles: InterpolationWithTheme<any>
'React' must be in scope when using JSX eslintreact/react-in-jsx-scope

More info: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md

Screen Shot 2020-11-19 at 10 50 30 AM

Again, after last pull.

@Vadorequest
Copy link
Member

Yeah, there is some issues about this that aren't directly related to NRN. See vercel/next.js#18096 (comment)

I didn't spot this, though (or, did I fix it on my private fork but forgot to fix it in NRN? 🤔 ).

I believe you can remove that particular rule from your project (react/react-in-jsx-scope) in eslintrc. As React is no longer needed.

Stuff to do with Babel, TypeScript and other complicated stuff. As long as it compiles fine, the eslint rule can be removed.

@samuelcastro
Copy link
Contributor Author

Isn't better keep the rule and import React consistently just like the rest of the project?

@Vadorequest
Copy link
Member

Not if it's not necessary. It was only done before because it was a requirement, but it's not the case anymore.

Also, code linters always complained about React being imported yet unused.

@samuelcastro
Copy link
Contributor Author

ok.

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