diff --git a/docs/rules/prefer-stateless-function.md b/docs/rules/prefer-stateless-function.md index 757fc7b5bc..3415799b81 100644 --- a/docs/rules/prefer-stateless-function.md +++ b/docs/rules/prefer-stateless-function.md @@ -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 diff --git a/lib/rules/prefer-stateless-function.js b/lib/rules/prefer-stateless-function.js index 8669f327af..2cdeec147c 100644 --- a/lib/rules/prefer-stateless-function.js +++ b/lib/rules/prefer-stateless-function.js @@ -17,6 +17,7 @@ module.exports = Components.detect(function(context, components, utils) { var lifecycleMethods = [ 'state', 'getInitialState', + 'getChildContext', 'componentWillMount', 'componentDidMount', 'componentWillReceiveProps',