mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 06:04:15 +00:00
[ReactNative] Avoid Navigator invariant in edge case
Summary: It is very rare, but sometimes there is no active gesture when the responder gets released. This will avoid a redbox in that case @public Test Plan: Saw the redbox. No longer see the redbox. Hardcoded missing activeGesture while responder and verified no redbox
This commit is contained in:
parent
43e7e69841
commit
349f8b942a
@ -716,6 +716,10 @@ var Navigator = React.createClass({
|
||||
_handlePanResponderRelease: function(e, gestureState) {
|
||||
var sceneConfig = this.state.sceneConfigStack[this.state.presentedIndex];
|
||||
var releaseGestureAction = this.state.activeGesture;
|
||||
if (!releaseGestureAction) {
|
||||
// The gesture may have been detached while responder, so there is no action here
|
||||
return;
|
||||
}
|
||||
var releaseGesture = sceneConfig.gestures[releaseGestureAction];
|
||||
var destIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture);
|
||||
if (this.spring.getCurrentValue() === 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user