Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 548 Bytes

no-unused-class-component-methods.md

File metadata and controls

31 lines (25 loc) · 548 Bytes

Prevent declaring unused methods of component class (react/no-unused-class-component-methods)

Warns you if you have defined a method but it is never being used anywhere.

Rule Details

The following patterns are considered warnings:

class Foo extends React.Component {
  handleClick() {}
  render() {
    return null;
  }
}

The following patterns are not considered warnings:

class Foo extends React.Component {
  action() {}
  componentDidMount() {
    this.action();
  }
  render() {
    return null;
  }
}
});