Skip to content

Commit

Permalink
Fix missing getChildContext lifecycle method in prefer-stateless-func…
Browse files Browse the repository at this point in the history
…tion (fixes #492)
  • Loading branch information
yannickcr committed Mar 8, 2016
1 parent ad52cb2 commit 17f105c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rules/prefer-stateless-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Stateless functional components are more simple than class based components and

This rule will check your class based React components for

* lifecycle methods: `state`, `getInitialState`, `componentWillMount`, `componentDidMount`, `componentWillReceiveProps`, `shouldComponentUpdate`, `componentWillUpdate`, `componentDidUpdate` and `componentWillUnmount`
* lifecycle methods: `state`, `getInitialState`, `getChildContext`, `componentWillMount`, `componentDidMount`, `componentWillReceiveProps`, `shouldComponentUpdate`, `componentWillUpdate`, `componentDidUpdate` and `componentWillUnmount`
* usage of `this.setState`
* presence of `ref` attribute in JSX

Expand Down
1 change: 1 addition & 0 deletions lib/rules/prefer-stateless-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = Components.detect(function(context, components, utils) {
var lifecycleMethods = [
'state',
'getInitialState',
'getChildContext',
'componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
Expand Down

0 comments on commit 17f105c

Please sign in to comment.