---
# Don't modify this file manually. This file is auto generated from source, and you will lose your changes next time the website is built.
# Head to the `biomejs/biome` repository, and modify the source code in there.

title: noSolidDestructuredProps
description: Learn more about noSolidDestructuredProps
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="JavaScript (and super languages)" icon="seti:javascript">
## Summary
- Rule available since: `v2.0.0`
- Diagnostic Category: [`lint/correctness/noSolidDestructuredProps`](/reference/diagnostics#diagnostic-category)
- This rule isn't recommended, so you need to enable it.
- This rule doesn't have a fix.
- The default severity of this rule is [**information**](/reference/diagnostics#information).
- This rule belongs to the following domains:
  - [`solid`](/linter/domains#solid)
- Sources: 
  - Inspired from [`solid/no-destructure`](https://github.com/solidjs-community/eslint-plugin-solid/blob/main/packages/eslint-plugin-solid/docs/no-destructure.md)

## How to configure
```json title="biome.json"
{
	"linter": {
		"rules": {
			"correctness": {
				"noSolidDestructuredProps": "error"
			}
		}
	}
}

```
## Description
Disallow destructuring props inside JSX components in Solid projects.

In Solid, props must be used with property accesses (props.foo) to preserve reactivity.

## Examples

### Invalid

```jsx
let Component = ({}) => <div />;
```

<pre class="language-text"><code class="language-text">code-block.jsx:1:18 <a href="https://biomejs.dev/linter/rules/no-solid-destructured-props">lint/correctness/noSolidDestructuredProps</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">You cannot destructure props.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>let Component = (&#123;&#125;) =&gt; &lt;div /&gt;;<br />   <strong>   │ </strong>                 <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">In Solid, props must be used with property accesses (props.foo) to preserve reactivity.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Remove the destructuring and use props.foo instead.</span><br />  <br /></code></pre>

```jsx
let Component = ({ a: A }) => <div a={A} />;
```

<pre class="language-text"><code class="language-text">code-block.jsx:1:39 <a href="https://biomejs.dev/linter/rules/no-solid-destructured-props">lint/correctness/noSolidDestructuredProps</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">This variable shouldn't be destructured.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>let Component = (&#123; a: A &#125;) =&gt; &lt;div a=&#123;A&#125; /&gt;;<br />   <strong>   │ </strong>                                      <strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">This is where the props were destructured.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>let Component = (&#123; a: A &#125;) =&gt; &lt;div a=&#123;A&#125; /&gt;;<br />   <strong>   │ </strong>                 <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">In Solid, props must be used with property accesses (props.foo) to preserve reactivity.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Remove the destructuring and use props.foo instead.</span><br />  <br /></code></pre>

```tsx
let Component = ({ prop1 }: Props) => <div p1={prop1} />;
```

<pre class="language-text"><code class="language-text">code-block.tsx:1:48 <a href="https://biomejs.dev/linter/rules/no-solid-destructured-props">lint/correctness/noSolidDestructuredProps</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">This variable shouldn't be destructured.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>let Component = (&#123; prop1 &#125;: Props) =&gt; &lt;div p1=&#123;prop1&#125; /&gt;;<br />   <strong>   │ </strong>                                               <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">This is where the props were destructured.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>let Component = (&#123; prop1 &#125;: Props) =&gt; &lt;div p1=&#123;prop1&#125; /&gt;;<br />   <strong>   │ </strong>                 <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">In Solid, props must be used with property accesses (props.foo) to preserve reactivity.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Remove the destructuring and use props.foo instead.</span><br />  <br /></code></pre>

### Valid

```jsx
let Component = (props) => <div />;
```

```jsx
let Component = (props) => <div a={props.a} />;
```

## Related links

- [Disable a rule](/linter/#disable-a-rule)
- [Configure the code fix](/linter#configure-the-code-fix)
- [Rule options](/linter/#rule-options)
- [Source Code](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/src/lint/correctness/no_solid_destructured_props.rs)
- [Test Cases](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/tests/specs/correctness/noSolidDestructuredProps)

</TabItem>
</Tabs>