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:
Richard Lai 2016-03-05 15:47:51 -08:00 committed by Facebook Github Bot 3
parent a340105360
commit ebf5842fe6

View File

@ -106,7 +106,7 @@ class NavigationAnimatedView
_animatedWidth: Animated.Value;
_lastHeight: number;
_lastWidth: number;
_postionListener: any;
_positionListener: any;
props: Props;
state: State;
@ -129,7 +129,7 @@ class NavigationAnimatedView
});
}
componentDidMount() {
this._postionListener = this.state.position.addListener(this._onProgressChange.bind(this));
this._positionListener = this.state.position.addListener(this._onProgressChange.bind(this));
}
componentWillReceiveProps(nextProps) {
if (nextProps.navigationState !== this.props.navigationState) {
@ -144,9 +144,9 @@ class NavigationAnimatedView
}
}
componentWillUnmount() {
if (this.postionListener) {
this.state.position.removeListener(this._postionListener);
this._postionListener = null;
if (this._positionListener) {
this.state.position.removeListener(this._positionListener);
this._positionListener = null;
}
}
_onProgressChange(data: Object): void {