-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
- Do not allow constuctor in React Components
- Force static propTypes proporty
I am not sure if this rules should be here. Maybe it is better to create a pull request to eslint-plugin-react
Considered bad:
class List extends React.Component {
constructor(props) {
super(props);
}
handleClick() {
}
render() {
<button onClick={this.handleClick} />
}
}Considered good:
class List extends React.Component {
static propTypes = {};
state = {};
handleClick = () => {
};
render() {
<button onClick={this.handleClick} />
}
}