Skip to content

Commit 805c8ea

Browse files
committed
Add docs
1 parent 150b775 commit 805c8ea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/rules/forbid-component-props.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@ The following patterns are **not** considered warnings:
3535

3636
```js
3737
...
38-
"react/forbid-component-props": [<enabled>, { "forbid": [<string>] }]
38+
"react/forbid-component-props": [<enabled>, { "forbid": [<string>|<object>] }]
3939
...
4040
```
4141

4242
### `forbid`
4343

44-
An array of strings, with the names of props that are forbidden. The default value of this option is `['className', 'style']`.
44+
An array specifying the names of props that are forbidden. The default value of this option is `['className', 'style']`.
45+
Each array element can either be a string with the property name or object specifying the property name and a component whitelist:
46+
47+
```js
48+
{
49+
"propName": "someProp",
50+
"allowedFor": [SomeComponent, AnotherComponent]
51+
}
52+
```
4553

4654

4755
### Related rules

0 commit comments

Comments
 (0)