Two options
Temporarily disable the warning
(Not verified, and there are several ways to do this.)
export class myComponent extends React.Component {
...
}
Use a clean, stateless component
The return value is what will be displayed (for example, you basically write a render
component method based on a class:
export const myComponent = () => {
return (
)
}
( -ES6, .)
,
export MyComponent = () =>
<div>
// Stuff here
</div>
. , React, .
ESLint JSX, .
, :
const MyComponent = (props) =>
<div>
<Something someProp={props.foo} />
</div>
export MyComponent
:
const MyComponent = ({ foo }) =>
<div>
<Something someProp={foo} />
</div>
, . ESLint PropTypes
; , static propTypes
, ( ).