# useReactNamingConvention

Rule `biome/useReactNamingConvention`. Enforces naming conventions for React `createContext`, `useId`, and `useRef`.

- Source: biome
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1966 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useReactNamingConvention` | no | no | group nursery, since 2.5.12 | [docs](https://biomejs.dev/linter/rules/use-react-naming-convention/) |

## Code examples

### Incorrect: the rule reports this

```jsx
import { createContext } from "react";
const theme = createContext("");
```

```jsx
import { useId } from "react";
const randomString = useId();
```

```jsx
import { useRef } from "react";
const node = useRef(null);
```

### Correct: the rule accepts this

```jsx
import { createContext } from "react";
const ThemeContext = createContext("");
```

```jsx
import { useId } from "react";
const myId = useId();
```

```jsx
import { useRef } from "react";
const myRef = useRef(null);
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

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

## Related rules

- [biome/useReactFunctionComponents](https://lintradar.dev/rules/biome/useReactFunctionComponents.md): Enforce that components are defined as functions and never as classes.
- [biome/useSolidForComponent](https://lintradar.dev/rules/biome/useSolidForComponent.md): Enforce using Solid's `<For />` component for mapping an array to JSX elements.
- [biome/useReactCompiler](https://lintradar.dev/rules/biome/useReactCompiler.md): Validate files with React Compiler.
- [biome/useSvelteStoreInitialValue](https://lintradar.dev/rules/biome/useSvelteStoreInitialValue.md): Require Svelte stores to be created with an initial value.
- [biome/usePackageJsonEngines](https://lintradar.dev/rules/biome/usePackageJsonEngines.md): Require the `engines` field in `package.json`.
- [biome/useTailwindShorthandClasses](https://lintradar.dev/rules/biome/useTailwindShorthandClasses.md): Enforce using fewer Tailwind utilities instead of multiple utilities that are functionally the same.

---

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