Skip to content

Commit

Permalink
Add customValidators option to prop-types documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Jul 27, 2015
1 parent b1a7b0c commit 63546ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/rules/prop-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It can warn other developers if they make a mistake while reusing the component

The following patterns are considered warnings:

```js
```jsx
var Hello = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
Expand All @@ -27,7 +27,7 @@ var Hello = React.createClass({

The following patterns are not considered warnings:

```js
```jsx
var Hello = React.createClass({
render: function() {
return <div>Hello World</div>;
Expand Down Expand Up @@ -58,12 +58,13 @@ This rule can take one argument to ignore some specific props during validation.

```
...
"prop-types": [<enabled>, { ignore: <ignore> }]
"prop-types": [<enabled>, { ignore: <ignore>, customValidators: <customValidator> }]
...
```

* `enabled`: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.
* `ignore`: optional array of props name to ignore during validation.
* `customValidators`: optional array of validators used for propTypes validation.

### As for "exceptions"

Expand Down

0 comments on commit 63546ee

Please sign in to comment.