// Add constructor() like:
exports class myComponent extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<div>Hello</div>
);
}
}
//Probably you have Slint rules that does not allow you to do write convenient code
//Use a pure stateless component
export const myComponent = () => return ()
/*Disable Slint Rules */
// eslint-disable-next-line react/prefer-stateless-function
export class myComponent extends React.Component {
...
}
class Foo extends React.PureComponent {
render() {
return <div>{this.props.foo}</div>;
}
}