# no-unused-prop-types

Rule `react/no-unused-prop-types`. Disallow definitions of unused propTypes

- Source: react
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 3.4M weekly downloads of presets that enable it
- Trend: +2.3% last quarter
- Rank: #1453 by reach, #1589 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/no-unused-prop-types` | no | no | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-unused-prop-types.md) |

## Code examples

### Incorrect: the rule reports this

```jsx
class Hello extends React.Component {
  render() {
    return <div>Hello Bob</div>;
  }
}

Hello.propTypes = {
  name: PropTypes.string
};
```

```jsx
type Props = {
  firstname: string;
  middlename: string; // middlename is never used by the Hello component
  lastname: string;
}

class Hello extends React.Component<Props> {
  render() {
    return <div>Hello {this.props.firstname} {this.props.lastname}</div>;
  }
}
```

```jsx
type Props = {
  firstname: string;
  lastname: string;  // lastname isn't used by the Hello component
};

class Hello extends React.Component<Props> {
  render() {
    return <div>Hello {this.props.firstname}</div>;
  }
}

class Greetings extends React.Component<Props> {
  render() {
    return <div>Greetings  {this.props.firstname} {this.props.lastname}</div>;
  }
}
```

### Correct: the rule accepts this

```jsx
class Hello extends React.Component {
  render() {
    return <div>Hello {this.props.name}</div>;
  }
}

Hello.propTypes = {
  name: PropTypes.string
};
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import react from "eslint-plugin-react";

export default [
  {
    plugins: { react },
    rules: {
      "react/no-unused-prop-types": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |

## Related rules

- [react/no-unused-class-component-methods](https://lintradar.dev/rules/react/no-unused-class-component-methods.md): Disallow declaring unused methods of component class
- [react/no-unused-state](https://lintradar.dev/rules/react/no-unused-state.md): Disallow definitions of unused state
- [react/no-invalid-html-attribute](https://lintradar.dev/rules/react/no-invalid-html-attribute.md): Disallow usage of invalid attributes
- [react/prefer-exact-props](https://lintradar.dev/rules/react/prefer-exact-props.md): Prefer exact proptype definitions
- [react/no-arrow-function-lifecycle](https://lintradar.dev/rules/react/no-arrow-function-lifecycle.md): Lifecycle methods should be methods on the prototype, not class fields
- [react/prefer-stateless-function](https://lintradar.dev/rules/react/prefer-stateless-function.md): Enforce stateless components to be written as a pure function

---

Web page: https://lintradar.dev/rules/react/no-unused-prop-types. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
