# function-component-definition

Rule `react/function-component-definition`. Enforce a specific function type for function components

- Source: react
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 3.4M weekly downloads of presets that enable it
- Trend: +2.3% last quarter
- Rank: #1426 by reach, #1562 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/function-component-definition` | no | safe | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/function-component-definition.md) |
| Oxlint | `react/function-component-definition` | no | suggestion | plugin `react`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/function-component-definition.html) |
| Biome | `nursery/useReactFunctionComponentDefinition` | no | unsafe | group nursery, since 2.5.0 | [docs](https://biomejs.dev/linter/rules/use-react-function-component-definition/) |

## Code examples

### Incorrect: the rule reports this

```jsx
// function expression for named component
const Component = function (props) {
  return <div>{props.content}</div>;
};

// arrow function for named component
const Component = (props) => {
  return <div>{props.content}</div>;
};

// arrow function for unnamed component
function getComponent() {
  return (props) => {
    return <div>{props.content}</div>;
  };
}
```

### Correct: the rule accepts this

```js
export default function getComponent () {
  return <div />;
}
```

```js
export default var getComponent = () => {
  return <div />;
}

export default var getComponent = function () {
  return <div />;
}
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { react },
    rules: {
      "react/function-component-definition": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/function-component-definition": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useReactFunctionComponentDefinition": "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/static-property-placement](https://lintradar.dev/rules/react/static-property-placement.md): Enforces where React component static properties should be positioned.
- [react/jsx-boolean-value](https://lintradar.dev/rules/react/jsx-boolean-value.md): Enforce boolean attributes notation in JSX
- [react/prefer-es6-class](https://lintradar.dev/rules/react/prefer-es6-class.md): Enforce ES5 or ES6 class for React 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-props-no-spreading](https://lintradar.dev/rules/react/jsx-props-no-spreading.md): Disallow JSX prop spreading
- [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

---

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