# react

> React components: the recommended React and hooks rules as errors, and react-refresh rules, so Fast Refresh keeps component state.

React components: the recommended React and hooks rules as errors, and react-refresh rules, so Fast Refresh keeps component state. It requires [`javascript`](/reference/configurations/javascript/).

## Selected when

gspot selects it in a scope with dependencies `react`. A configuration that requires it selects it too: [`nextjs`](/reference/configurations/nextjs/), [`react-dom`](/reference/configurations/react-dom/), [`react-native`](/reference/configurations/react-native/).

## Lint rules turned off

| Lint rules                                             | Files                  | Why                                                                                                                     |
| ------------------------------------------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `gspot/no-trivial-files`, `gspot/no-trivial-functions` | `**/*.tsx`, `**/*.jsx` | React renders a component by its name, so a component of one statement, alone in its file, is the shape React asks for. |

## Defaults set for other configurations

| Setting                         | Value             |
| ------------------------------- | ----------------- |
| `tools.eslint.import_extension` | `"extensionless"` |

## Rules for coding agents

| Rule file                                              | Installed when |
| ------------------------------------------------------ | -------------- |
| `.gspot/configurations/framework/react/rules/REACT.md` | Always         |

## Tools and versions

| Tool                        | Version  |
| --------------------------- | -------- |
| eslint-plugin-react-hooks   | `7.1.1`  |
| eslint-plugin-react         | `7.37.5` |
| eslint-plugin-react-refresh | `0.5.7`  |
