diff --git a/docs/rules/prefer-stateless-function.md b/docs/rules/prefer-stateless-function.md index f55f6ebbb5..5bedda460c 100644 --- a/docs/rules/prefer-stateless-function.md +++ b/docs/rules/prefer-stateless-function.md @@ -8,8 +8,8 @@ This rule will check your class based React components for * methods/properties other than `displayName`, `propTypes`, `render` and useless constructor (same detection as ESLint [no-useless-constructor rule](http://eslint.org/docs/rules/no-useless-constructor)) * instance property other than `this.props` and `this.context` -* `render` method that return anything but JSX (`undefined`, `null`, etc.) * presence of `ref` attribute in JSX +* `render` method that return anything but JSX: `undefined`, `null`, etc. (only in React <15.0.0, see [shared settings](https://github.com/yannickcr/eslint-plugin-react/blob/master/README.md#configuration) for React version configuration) If none of these 4 elements are found, the rule will warn you to write this component as a pure function. @@ -23,7 +23,7 @@ var Hello = React.createClass({ }); ``` -The following patterns are not considered warnings: +The following pattern is not considered warnings: ```js const Foo = function(props) { @@ -31,6 +31,8 @@ const Foo = function(props) { }; ``` +The following pattern is not considered warning in React <15.0.0: + ```js class Foo extends React.Component { render() {