'React' is defined but never used
See original GitHub issuesrc/client/index.jsx
--------------------
error 'React' is defined but never used no-unused-vars
My .eslintrc:
{
"extends": "airbnb",
"plugins": [
"react"
]
}
Package versions:
"eslint": "^2.7.0",
"eslint-config-airbnb": "^6.2.0",
"eslint-plugin-react": "^4.2.3",
I’ve tried setting ‘React’ under globals, I’ve tried adding the jsx-uses-react
rule, (which appears to be set already). Neither worked for me. Removing "extends": "airbnb"
fixes this issue.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
ESLint with React gives `no-unused-vars` errors
Line 5:17: 'setBlog' is assigned a value but never used no-unused-vars Search for the keywords to learn more about each warning.
Read more >'React' is defined but never used no-unused-vars #11183
When i run eslint on my code, I get the error: 'React' is defined but never used no-unused-vars when I remove import 'React'...
Read more >Assigned a Value but Never Used | React JS Debugging
Assigned a Value but Never Used | No Unused Vars | React JS Debugging | Eslint Warnings & Errors.
Read more >JavaScript : ESLint with React gives `no-unused-vars` errors
JavaScript : ESLint with React gives ` no-unused-vars ` errors [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >'React' is defined but never used
The error is because you didn't use React. If you use React or write any react tag (like <App />) the error is...
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
Whoops. Seems obvious, now that you say it. Thanks for the help!
ok, so why are you importing React in
index.jsx
when you have no JSX, and you don’t referenceReact
?