X Tutup
Skip to content

Commit ebf5842

Browse files
rclaiFacebook Github Bot 3
authored andcommitted
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 facebook/react-native#6309 Differential Revision: D3016576 fb-gh-sync-id: 608a39ad293154e47480003bc9b450b521cddbb1 shipit-source-id: 608a39ad293154e47480003bc9b450b521cddbb1
1 parent a340105 commit ebf5842

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Libraries/NavigationExperimental/NavigationAnimatedView.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class NavigationAnimatedView
106106
_animatedWidth: Animated.Value;
107107
_lastHeight: number;
108108
_lastWidth: number;
109-
_postionListener: any;
109+
_positionListener: any;
110110

111111
props: Props;
112112
state: State;
@@ -129,7 +129,7 @@ class NavigationAnimatedView
129129
});
130130
}
131131
componentDidMount() {
132-
this._postionListener = this.state.position.addListener(this._onProgressChange.bind(this));
132+
this._positionListener = this.state.position.addListener(this._onProgressChange.bind(this));
133133
}
134134
componentWillReceiveProps(nextProps) {
135135
if (nextProps.navigationState !== this.props.navigationState) {
@@ -144,9 +144,9 @@ class NavigationAnimatedView
144144
}
145145
}
146146
componentWillUnmount() {
147-
if (this.postionListener) {
148-
this.state.position.removeListener(this._postionListener);
149-
this._postionListener = null;
147+
if (this._positionListener) {
148+
this.state.position.removeListener(this._positionListener);
149+
this._positionListener = null;
150150
}
151151
}
152152
_onProgressChange(data: Object): void {

0 commit comments

Comments
 (0)
X Tutup