Skip to content

Commit

Permalink
lifecycle methods util
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtan committed Sep 17, 2018
1 parent 0edfa24 commit 8a7b2e3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
21 changes: 1 addition & 20 deletions lib/rules/no-arrow-function-lifecycle.js
Expand Up @@ -7,26 +7,7 @@
const Components = require('../util/Components');
const astUtil = require('../util/ast');
const docsUrl = require('../util/docsUrl');

const lifecycleMethods = [
'getDefaultProps',
'getInitialState',
'getChildContext',
'getDerivedStateFromProps',
'componentWillMount',
'UNSAFE_componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'UNSAFE_componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'UNSAFE_componentWillUpdate',
'getSnapshotBeforeUpdate',
'componentDidUpdate',
'componentDidCatch',
'componentWillUnmount',
'render'
];
const lifecycleMethods = require('../util/lifecycleMethods');

module.exports = {
meta: {
Expand Down
25 changes: 25 additions & 0 deletions lib/util/lifecycleMethods.js
@@ -0,0 +1,25 @@
/**
* @fileoverview lifecycle methods
* @author Tan Nguyen
*/
'use strict';

module.exports = [
'getDefaultProps',
'getInitialState',
'getChildContext',
'getDerivedStateFromProps',
'componentWillMount',
'UNSAFE_componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'UNSAFE_componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'UNSAFE_componentWillUpdate',
'getSnapshotBeforeUpdate',
'componentDidUpdate',
'componentDidCatch',
'componentWillUnmount',
'render'
];

0 comments on commit 8a7b2e3

Please sign in to comment.