# react-in-jsx-scope

Rule `react/react-in-jsx-scope`. Disallow missing React when using JSX

- Source: react
- Technologies: React
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 84.5M weekly downloads of presets that enable it
- Trend: +32.5% last quarter
- Rank: #210 by reach, #1072 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/react-in-jsx-scope` | yes | no | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/react-in-jsx-scope.md) |
| Oxlint | `react/react-in-jsx-scope` | no | no | plugin `react`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/react-in-jsx-scope.html) |

## Code examples

### Incorrect: the rule reports this

```jsx
var Hello = <div>Hello {this.props.name}</div>;
```

```jsx
/** @jsx Foo.bar */
var React = require('react');

var Hello = <div>Hello {this.props.name}</div>;
```

### Correct: the rule accepts this

```jsx
import React from 'react';

var Hello = <div>Hello {this.props.name}</div>;
```

```jsx
var React = require('react');

var Hello = <div>Hello {this.props.name}</div>;
```

```jsx
/** @jsx Foo.bar */
var Foo = require('foo');

var Hello = <div>Hello {this.props.name}</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/react-in-jsx-scope": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/react-in-jsx-scope": "error"
  }
}
```

## Presets that enable it

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

## Related rules

- [react/no-unknown-property](https://lintradar.dev/rules/react/no-unknown-property.md): Disallow usage of unknown DOM property
- [react/prop-types](https://lintradar.dev/rules/react/prop-types.md): Disallow missing props validation in a React component definition
- [react/jsx-no-target-blank](https://lintradar.dev/rules/react/jsx-no-target-blank.md): Disallow `target="_blank"` attribute without `rel="noreferrer"`
- [react/display-name](https://lintradar.dev/rules/react/display-name.md): Disallow missing displayName in a React component definition
- [react/no-deprecated](https://lintradar.dev/rules/react/no-deprecated.md): Disallow usage of deprecated methods
- [react/no-unescaped-entities](https://lintradar.dev/rules/react/no-unescaped-entities.md): Disallow unescaped HTML entities from appearing in markup

---

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