# no-object-type-as-default-prop

Rule `react/no-object-type-as-default-prop`. Disallow usage of referential-type variables as default param in functional component

- Source: react
- Technologies: React
- Kind: performance
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #471 by reach, #106 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/no-object-type-as-default-prop` | no | no | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/no-object-type-as-default-prop.md) |
| Oxlint | `react/no-object-type-as-default-prop` | no | no | plugin `react`, category perf | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/no-object-type-as-default-prop.html) |
| Biome | `nursery/noReactObjectTypeAsDefaultProp` | yes | no | group nursery, since 2.5.15 | [docs](https://biomejs.dev/linter/rules/no-react-object-type-as-default-prop/) |

## Code examples

### Incorrect: the rule reports this

```jsx
function Component({
  items = [],
}) {}

const Component = ({
  items = {},
}) => {}

const Component = ({
  items = () => {},
}) => {}
```

### Correct: the rule accepts this

```jsx
const emptyArray = [];

function Component({
  items = emptyArray,
}) {}

const emptyObject = {};
const Component = ({
  items = emptyObject,
}) => {}

const noopFunc = () => {};
const Component = ({
  items = noopFunc,
}) => {}

// primitives are all compared by value, so are safe to be inlined
function Component({
  num = 3,
  str = 'foo',
  bool = true,
}) {}
```

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-object-type-as-default-prop": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/no-object-type-as-default-prop": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noReactObjectTypeAsDefaultProp": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [react/no-danger](https://lintradar.dev/rules/react/no-danger.md): Disallow usage of dangerous JSX properties
- [react/no-array-index-key](https://lintradar.dev/rules/react/no-array-index-key.md): Disallow usage of Array index in keys
- [react/button-has-type](https://lintradar.dev/rules/react/button-has-type.md): Disallow usage of `button` elements without an explicit `type` attribute
- [react/void-dom-elements-no-children](https://lintradar.dev/rules/react/void-dom-elements-no-children.md): Disallow void DOM elements (e.g. `<img />`, `<br />`) from receiving children
- [react/jsx-no-useless-fragment](https://lintradar.dev/rules/react/jsx-no-useless-fragment.md): Disallow unnecessary fragments
- [react/prop-types](https://lintradar.dev/rules/react/prop-types.md): Disallow missing props validation in a React component definition

---

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