question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'React' is defined but never used

See original GitHub issue
src/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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
scwoodcommented, Apr 10, 2016

Whoops. Seems obvious, now that you say it. Thanks for the help!

1reaction
ljharbcommented, Apr 10, 2016

ok, so why are you importing React in index.jsx when you have no JSX, and you don’t reference React?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found