diff --git a/lib/TransitionItemsView.js b/lib/TransitionItemsView.js index 67a0f7f..c6a975b 100644 --- a/lib/TransitionItemsView.js +++ b/lib/TransitionItemsView.js @@ -80,7 +80,7 @@ export default class TransitionItemsView extends React.Component< _shouldRunStartAnimation: boolean = true; - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { this.updateFromProps(nextProps, this.props); } diff --git a/lib/TransitionView.js b/lib/TransitionView.js index 4f36072..59ad377 100644 --- a/lib/TransitionView.js +++ b/lib/TransitionView.js @@ -64,7 +64,7 @@ class Transition extends React.Component { return (this.props !== nextProps); } - componentWillMount() { + UNSAFE_componentWillMount() { const { route, register } = this.context; const { shared, appear, disappear, delay, zIndex, anchor, animated, inline = false } = this.props; diff --git a/lib/Utils/shallowRenderer.js b/lib/Utils/shallowRenderer.js index a24ca3b..074b8d4 100644 --- a/lib/Utils/shallowRenderer.js +++ b/lib/Utils/shallowRenderer.js @@ -112,6 +112,13 @@ class ShallowRenderer { _updateClassComponent(props, context) { const oldProps = this._instance.props; + if ( + oldProps !== props + && typeof this._instance.UNSAFE_componentWillReceiveProps === 'function' + ) { + this._instance.UNSAFE_componentWillReceiveProps(props, context); + } + if ( oldProps !== props && typeof this._instance.componentWillReceiveProps === 'function'