mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00:00
Fix listener name in NavigationAnimatedView
Summary:Should be self-explanatory. __Edit__: oh turns out I fixed a memory leak too because of a typo of the typo on teardown. cc ericvicenti Closes https://github.com/facebook/react-native/pull/6309 Differential Revision: D3016576 fb-gh-sync-id: 608a39ad293154e47480003bc9b450b521cddbb1 shipit-source-id: 608a39ad293154e47480003bc9b450b521cddbb1
This commit is contained in:
parent
a340105360
commit
ebf5842fe6
@ -106,7 +106,7 @@ class NavigationAnimatedView
|
|||||||
_animatedWidth: Animated.Value;
|
_animatedWidth: Animated.Value;
|
||||||
_lastHeight: number;
|
_lastHeight: number;
|
||||||
_lastWidth: number;
|
_lastWidth: number;
|
||||||
_postionListener: any;
|
_positionListener: any;
|
||||||
|
|
||||||
props: Props;
|
props: Props;
|
||||||
state: State;
|
state: State;
|
||||||
@ -129,7 +129,7 @@ class NavigationAnimatedView
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this._postionListener = this.state.position.addListener(this._onProgressChange.bind(this));
|
this._positionListener = this.state.position.addListener(this._onProgressChange.bind(this));
|
||||||
}
|
}
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (nextProps.navigationState !== this.props.navigationState) {
|
if (nextProps.navigationState !== this.props.navigationState) {
|
||||||
@ -144,9 +144,9 @@ class NavigationAnimatedView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (this.postionListener) {
|
if (this._positionListener) {
|
||||||
this.state.position.removeListener(this._postionListener);
|
this.state.position.removeListener(this._positionListener);
|
||||||
this._postionListener = null;
|
this._positionListener = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_onProgressChange(data: Object): void {
|
_onProgressChange(data: Object): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user