# useSolidForComponent

Rule `biome/useSolidForComponent`. Enforce using Solid's `<For />` component for mapping an array to JSX elements.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `performance/useSolidForComponent` | no | no | group performance, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-solid-for-component/) |

## Code examples

### Incorrect: the rule reports this

```jsx
let Component = (props) => <ol>{props.data.map(d => <li>{d.text}</li>)}</ol>;
```

```jsx
let Component = (props) => <>{props.data.map(d => <li>{d.text}</li>)}</>;
```

```jsx
let Component = (props) => (
  <ol>
    {props.data.map((d) => (
      <li key={d.id}>{d.text}</li>
    ))}
  </ol>
);
```

### Correct: the rule accepts this

```jsx
let Component = (props) => <ol><For each={props.data}>{d => <li>{d.text}</li>}</For></ol>;
```

```jsx
let abc = x.map(y => y + z);
```

```jsx
let Component = (props) => {
 let abc = x.map(y => y + z);
 return <div>Hello, world!</div>;
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "performance": {
        "useSolidForComponent": "error"
      }
    }
  }
}
```

## Related rules

- [biome/useReactNamingConvention](https://lintradar.dev/rules/biome/useReactNamingConvention.md): Enforces naming conventions for React `createContext`, `useId`, and `useRef`.
- [biome/useSvelteStoreInitialValue](https://lintradar.dev/rules/biome/useSvelteStoreInitialValue.md): Require Svelte stores to be created with an initial value.
- [biome/useReactFunctionComponents](https://lintradar.dev/rules/biome/useReactFunctionComponents.md): Enforce that components are defined as functions and never as classes.
- [biome/useTailwindShorthandClasses](https://lintradar.dev/rules/biome/useTailwindShorthandClasses.md): Enforce using fewer Tailwind utilities instead of multiple utilities that are functionally the same.
- [biome/useReactCompiler](https://lintradar.dev/rules/biome/useReactCompiler.md): Validate files with React Compiler.
- [biome/useTailwindStaticClassStrings](https://lintradar.dev/rules/biome/useTailwindStaticClassStrings.md): Require complete, statically written class names.

---

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