Skip to content

Commit

Permalink
fix(componentLifecycleDecorator): revert to componentWillReceiveProps
Browse files Browse the repository at this point in the history
* This reverts commit b42b58e.
* Ref #206
  • Loading branch information
tomchentw committed Feb 21, 2016
1 parent 7ee7bdb commit 105dc6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/componentLifecycleDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function componentLifecycleDecorator({ registerEvents, instanceMe

// Stash component's own lifecycle methods to be invoked later
const componentDidMount = Component.prototype.hasOwnProperty(`componentDidMount`) ? Component.prototype.componentDidMount : noop;
const componentWillReceiveProps = Component.prototype.hasOwnProperty(`componentWillReceiveProps`) ? Component.prototype.componentWillReceiveProps : noop;
const componentDidUpdate = Component.prototype.hasOwnProperty(`componentDidUpdate`) ? Component.prototype.componentDidUpdate : noop;
const componentWillUnmount = Component.prototype.hasOwnProperty(`componentWillUnmount`) ? Component.prototype.componentWillUnmount : noop;

Object.defineProperty(Component.prototype, `componentDidMount`, {
Expand All @@ -35,7 +35,7 @@ export default function componentLifecycleDecorator({ registerEvents, instanceMe
},
});

Object.defineProperty(Component.prototype, `componentWillReceiveProps`, {
Object.defineProperty(Component.prototype, `componentDidUpdate`, {
enumerable: false,
configurable: true,
writable: true,
Expand All @@ -49,7 +49,7 @@ export default function componentLifecycleDecorator({ registerEvents, instanceMe
}

// Hook into client's implementation, if it has any
componentWillReceiveProps.call(this, prevProps);
componentDidUpdate.call(this, prevProps);

register.call(this);
},
Expand Down

0 comments on commit 105dc6b

Please sign in to comment.