# static-property-placement

Rule `react/static-property-placement`. Enforces where React component static properties should be positioned.

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
class MyComponent extends React.Component {
  static get childContextTypes() { /*...*/ }
  static get contextTypes() { /*...*/ }
  static get contextType() { /*...*/ }
  static get displayName() { /*...*/ }
  static get defaultProps() { /*...*/ }
  static get propTypes() { /*...*/ }
}
```

```js
class MyComponent extends React.Component { /*...*/ }
MyComponent.childContextTypes = { /*...*/ };
MyComponent.contextTypes = { /*...*/ };
MyComponent.contextType = { /*...*/ };
MyComponent.displayName = "Hello";
MyComponent.defaultProps = { /*...*/ };
MyComponent.propTypes = { /*...*/ };
```

```js
class MyComponent extends React.Component {
  static childContextTypes = { /*...*/ };
  static contextTypes = { /*...*/ };
  static contextType = { /*...*/ };
  static displayName = "Hello";
  static defaultProps = { /*...*/ };
  static propTypes = { /*...*/ };
}
```

### Correct: the rule accepts this

```js
class MyComponent extends React.Component {
  static childContextTypes = { /*...*/ };
  static contextTypes = { /*...*/ };
  static contextType = { /*...*/ };
  static displayName = "Hello";
  static defaultProps = { /*...*/ };
  static propTypes = { /*...*/ };
}
```

```js
class MyComponent extends React.Component {
  static get childContextTypes() { /*...*/ }
  static get contextTypes() { /*...*/ }
  static get contextType() { /*...*/ }
  static get displayName() { /*...*/ }
  static get defaultProps() { /*...*/ }
  static get propTypes() { /*...*/ }
}
```

```js
class MyComponent extends React.Component { /*...*/ }
MyComponent.childContextTypes = { /*...*/ };
MyComponent.contextTypes = { /*...*/ };
MyComponent.contextType = { /*...*/ };
MyComponent.displayName = "Hello";
MyComponent.defaultProps = { /*...*/ };
MyComponent.propTypes = { /*...*/ };
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { react },
    rules: {
      "react/static-property-placement": "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% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [react/prefer-es6-class](https://lintradar.dev/rules/react/prefer-es6-class.md): Enforce ES5 or ES6 class for React Components
- [react/function-component-definition](https://lintradar.dev/rules/react/function-component-definition.md): Enforce a specific function type for function components
- [react/no-this-in-sfc](https://lintradar.dev/rules/react/no-this-in-sfc.md): Disallow `this` from being used in stateless functional components
- [react/jsx-boolean-value](https://lintradar.dev/rules/react/jsx-boolean-value.md): Enforce boolean attributes notation in JSX
- [react/no-redundant-should-component-update](https://lintradar.dev/rules/react/no-redundant-should-component-update.md): Disallow usage of shouldComponentUpdate when extending React.PureComponent
- [react/no-namespace](https://lintradar.dev/rules/react/no-namespace.md): Enforce that namespaces are not used in React elements

---

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