# jsx-uses-vars

Rule `react/jsx-uses-vars`. Disallow variables used in JSX to be incorrectly marked as unused

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
var Hello = require('./Hello');
```

### Correct: the rule accepts this

```jsx
var Hello = require('./Hello');

<Hello name="John" />;
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { react },
    rules: {
      "react/jsx-uses-vars": "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% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [vue/jsx-uses-vars](https://lintradar.dev/rules/vue/jsx-uses-vars.md): Prevent variables used in JSX to be marked as unused
- [react/jsx-uses-react](https://lintradar.dev/rules/react/jsx-uses-react.md): Disallow React to be incorrectly marked as unused
- [react/no-direct-mutation-state](https://lintradar.dev/rules/react/no-direct-mutation-state.md): Disallow direct mutation of this.state
- [react/require-render-return](https://lintradar.dev/rules/react/require-render-return.md): Enforce ES5 or ES6 class for returning value in render function
- [react/no-find-dom-node](https://lintradar.dev/rules/react/no-find-dom-node.md): Disallow usage of findDOMNode
- [react/no-is-mounted](https://lintradar.dev/rules/react/no-is-mounted.md): Disallow usage of isMounted

---

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