Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
108
rated 0 times [  110] [ 2]  / answers: 1 / hits: 16264  / 7 Years ago, sun, april 23, 2017, 12:00:00

This is the config i have for eslint in .eslintrc.json file:



 {
env: {
browser: true,
commonjs: true,
es6: true
},
extends: eslint:recommended,
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true
},
sourceType: module
},
plugins: [
react
],
rules: {
react/jsx-uses-react: error,
react/jsx-uses-vars: [error],
indent: 0,
linebreak-style: [
error,
windows
],
quotes: [
error,
single
],
semi: [
error,
always
]
},
settings: {
react: {
pragma: React,
version: 15.0
}
}
}


This is the app.jsx from the react workspace below:



 import React, { Component } from 'react';

class App extends React.Component {
render () {
return(
<h1>Hello Newbies</h1>
);
}
}

export default App;


I am getting error from eslint 'Component' is defined but never used. I can not fix this by doing anything so far but digging the web. How can i fix this error? Help would be very much appreciated.


More From » reactjs

 Answers
173

Try



class App extends Component {

[#58038] Thursday, April 20, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stacie

Total Points: 476
Total Questions: 92
Total Answers: 102

Location: Bosnia and Herzegovina
Member since Tue, Mar 29, 2022
2 Years ago
stacie questions
Fri, Jun 26, 20, 00:00, 4 Years ago
Thu, Jan 23, 20, 00:00, 4 Years ago
Fri, Aug 30, 19, 00:00, 5 Years ago
Fri, Aug 2, 19, 00:00, 5 Years ago
;