From ebf5842fe68374ddbd01a266ed07440fa7d84bad Mon Sep 17 00:00:00 2001 From: Richard Lai Date: Sat, 5 Mar 2016 15:47:51 -0800 Subject: [PATCH] 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 --- .../NavigationExperimental/NavigationAnimatedView.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/NavigationExperimental/NavigationAnimatedView.js b/Libraries/NavigationExperimental/NavigationAnimatedView.js index 5dade85ad31..845b4a7a061 100644 --- a/Libraries/NavigationExperimental/NavigationAnimatedView.js +++ b/Libraries/NavigationExperimental/NavigationAnimatedView.js @@ -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 {