Skip to content

Commit 4bd3779

Browse files
committed
Add documentation about component detection
1 parent 81c7d00 commit 4bd3779

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/rules/display-name.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,13 @@ function HelloComponent() {
8484
}
8585
module.exports = HelloComponent();
8686
```
87+
88+
## About component detection
89+
90+
For this rule to work we need to detect React components, this could be very hard since components could be declared in a lot of ways.
91+
92+
For now we should detect components created with:
93+
94+
* `React.createClass()`
95+
* an ES6 class that inherit from `React.Component` or `Component`
96+
* a stateless function that return JSX or the result of a `React.createElement` call.

docs/rules/prop-types.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ anything that can be rendered: numbers, strings, elements or an array containing
8383
these types.
8484

8585
Since 2.0.0 children is no longer ignored for props validation.
86+
87+
## About component detection
88+
89+
For this rule to work we need to detect React components, this could be very hard since components could be declared in a lot of ways.
90+
91+
For now we should detect components created with:
92+
93+
* `React.createClass()`
94+
* an ES6 class that inherit from `React.Component` or `Component`
95+
* a stateless function that return JSX or the result of a `React.createElement` call.

0 commit comments

Comments
 (0)