Skip to content

Commit 17f105c

Browse files
committed
Fix missing getChildContext lifecycle method in prefer-stateless-function (fixes #492)
1 parent ad52cb2 commit 17f105c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/rules/prefer-stateless-function.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Stateless functional components are more simple than class based components and
66

77
This rule will check your class based React components for
88

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

lib/rules/prefer-stateless-function.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = Components.detect(function(context, components, utils) {
1717
var lifecycleMethods = [
1818
'state',
1919
'getInitialState',
20+
'getChildContext',
2021
'componentWillMount',
2122
'componentDidMount',
2223
'componentWillReceiveProps',

0 commit comments

Comments
 (0)