react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

Very slow when tabPress on Android (solution review needed)

Open darron1217 opened this issue 3 years ago • 13 comments

Current behaviour

Jan-14-2021 20-05-08

Expected behaviour

Jan-14-2021 20-05-12

Code sample

   <Tab.Navigator backBehavior="none">
      <Tab.Screen
        name="Home"
        options={{tabBarLabel: '홈'}}
        component={HomeTab}
      />
...
    </Tab.Navigator>

Screenshots (if applicable)

Above

What have you tried

I changed jumpTo() method on Pager.tsx like below. And now it works as fast as expected.

before https://github.com/satya164/react-native-tab-view/blob/e1f96efa48644738757c0551382371095c3d476e/src/Pager.tsx#L422-L432

after

    this.jumpToIndex(index);
    if(navigationState.index !== index) {
      requestAnimationFrame(() => {
        // this is unnecessary, because jumpToIndex fires translateX change
        // onIndexChange(index);

        // When the index changes, the focused input will no longer be in current tab
        // So we should dismiss the keyboard
        if (keyboardDismissMode === 'auto') {
          Keyboard.dismiss();
        }
      })
    }

Is it a right approach to solve this problem?

(Edit) ~~After applying my fix, Swiping right after tabPress causes returning back to previous index. How about removing jumpToIndex in onIndexChange callback? I want to make onIndexChange event to be fired during/after jumpToIndex transition (not before transition).~~

~~And also adding debouncing option for changing index will improve performance.~~

(Edit2) I found that TabView's onIndexChange is fired even after removing onIndexChange from Pager. jumpToIndex fires translateX so this might be enough to fire index change. Now it works smoothly on my android oreo(8) device.

Your Environment

software version
ios or android android
expo x
react-native 0.63.3
react-native-tab-view 2.15.2
react-native-gesture-handler 1.7.0
react-native-reanimated 1.13.0
node 12.18
npm or yarn 6.14.8

darron1217 avatar Jan 14 '21 11:01 darron1217

Couldn't find version numbers for the following packages in the issue:

  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native (found: 0.63.3, latest: 0.63.4)
  • react-native-gesture-handler (found: 1.7.0, latest: 1.9.0)
  • react-native-reanimated (found: 1.13.0, latest: 1.13.2)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Jan 14 '21 11:01 github-actions[bot]

+1

IcedElect avatar Feb 27 '21 17:02 IcedElect

+1

alekaizer avatar Feb 27 '21 19:02 alekaizer

Here's the patch file that I'm using. You can patch it by patch-package.

react-native-tab-view+2.15.2.patch

diff --git a/node_modules/react-native-tab-view/lib/commonjs/Pager.js b/node_modules/react-native-tab-view/lib/commonjs/Pager.js
index 1c491e8..44105ff 100644
--- a/node_modules/react-native-tab-view/lib/commonjs/Pager.js
+++ b/node_modules/react-native-tab-view/lib/commonjs/Pager.js
@@ -178,22 +178,22 @@ class Pager extends React.Component {
     _defineProperty(this, "jumpTo", key => {
       const {
         navigationState,
-        keyboardDismissMode,
-        onIndexChange
+        keyboardDismissMode
       } = this.props;
       const index = navigationState.routes.findIndex(route => route.key === key); // A tab switch might occur when we're in the middle of a transition
       // In that case, the index might be same as before
       // So we conditionally make the pager to update the position
 
-      if (navigationState.index === index) {
-        this.jumpToIndex(index);
-      } else {
-        onIndexChange(index); // When the index changes, the focused input will no longer be in current tab
-        // So we should dismiss the keyboard
+      this.jumpToIndex(index);
 
-        if (keyboardDismissMode === 'auto') {
-          _reactNative.Keyboard.dismiss();
-        }
+      if (navigationState.index !== index) {
+        requestAnimationFrame(() => {
+          // When the index changes, the focused input will no longer be in current tab
+          // So we should dismiss the keyboard
+          if (keyboardDismissMode === 'auto') {
+            _reactNative.Keyboard.dismiss();
+          }
+        });
       }
     });
 
diff --git a/node_modules/react-native-tab-view/lib/commonjs/Pager.js.map b/node_modules/react-native-tab-view/lib/commonjs/Pager.js.map
index 4e1fce2..cd333db 100644
--- a/node_modules/react-native-tab-view/lib/commonjs/Pager.js.map
+++ b/node_modules/react-native-tab-view/lib/commonjs/Pager.js.map
@@ -1 +1 @@
-{"version":3,"sources":["Pager.tsx"],"names":["Easing","EasingNode","OldEasing","Clock","Value","onChange","and","or","abs","add","block","call","ceil","clockRunning","cond","divide","eq","event","floor","greaterThan","lessThan","max","min","multiply","neq","not","round","set","spring","startClock","stopClock","sub","timing","Animated","PagerContext","React","createContext","TRUE","FALSE","NOOP","UNSET","DIRECTION_LEFT","DIRECTION_RIGHT","SWIPE_DISTANCE_MINIMUM","SWIPE_VELOCITY_IMPACT","SPRING_CONFIG","stiffness","damping","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","SPRING_VELOCITY_SCALE","TIMING_CONFIG","duration","easing","out","cubic","Pager","Component","enabled","childPanGestureHandlerRefs","addGestureHandlerRef","ref","state","includes","mounted","setState","prevState","createRef","State","UNDETERMINED","props","navigationState","index","layout","width","routes","length","swipeVelocityImpact","undefined","springVelocityScale","layoutWidth","progress","springConfig","timingConfig","isSwipeGesture","setValue","nextIndex","key","keyboardDismissMode","onIndexChange","findIndex","route","jumpToIndex","Keyboard","dismiss","type","listener","enterListeners","push","indexOf","splice","value","Math","forEach","toValue","frameTime","position","time","finished","clock","I18nManager","isRTL","initialVelocityForSpring","velocityX","velocity","gestureX","nativeEvent","translationX","gestureState","gesturesEnabled","routesLength","toggleEnabled","currentIndexValue","pendingIndexValue","forceUpdate","lastEnteredIndex","handleEnteredIndexChange","isSwiping","indexAtSwipeEnd","currentIndex","onSwipeStart","onSwipeEnd","interactionHandle","InteractionManager","createInteractionHandle","input","TextInput","currentlyFocusedInput","currentlyFocusedField","blurTextInput","previouslyFocusedTextInput","clearInteractionHandle","focusTextInput","ACTIVE","maybeCancel","offsetX","transitionTo","extrapolatedPosition","translateX","componentDidMount","context","gestureHandlerRef","componentDidUpdate","prevProps","componentWillUnmount","render","swipeEnabled","children","removeClippedSubviews","gestureHandlerProps","getTranslateX","addListener","removeListener","jumpTo","handleGestureEvent","styles","container","transform","providerVal","StyleSheet","create","flex","flexDirection"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;AACA;;AAKA;;;;;;;;;;;;;;;;AAaA,MAAMA,MAAM,GAAGC,qCAAcC,6BAA7B;AA8BA,MAAM;AACJC,EAAAA,KADI;AAEJC,EAAAA,KAFI;AAGJC,EA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AAA,KAAK,EAAED,MAAM,CAACC,KAAP,GAAeH,eAAe,CAACI,MAAhB,CAAuBC,MAD/C;AAEE2F,UAAAA,SAAS,EAAE,CAAC;AAAEnB,YAAAA;AAAF,WAAD;AAFb,SADJ,GAKI,IAPC;AAFT,sBAYE,oBAAC,YAAD,CAAc,QAAd;AAAuB,QAAA,KAAK,EAAE,KAAKoB;AAAnC,SACGX,QADH,CAZF,CAXF;AANY,KAAD,CAAf;AAoCD;;AA1rBD;;;;gBAHmBrG,K,kBAIG;AACpBqB,EAAAA,mBAAmB,EAAEnC,qBADD;AAEpBqC,EAAAA,mBAAmB,EAAE7B;AAFD,C;;gBAJHM,K,iBA6HExB,Y;;AAmkBvB,MAAMqI,MAAM,GAAGI,wBAAWC,MAAX,CAAkB;AAC/BJ,EAAAA,SAAS,EAAE;AACTK,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,aAAa,EAAE;AAFN;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n  StyleSheet,\n  TextInput,\n  Keyboard,\n  I18nManager,\n  InteractionManager,\n} from 'react-native';\nimport { PanGestureHandler, State } from 'react-native-gesture-handler';\nimport Animated, {\n  Easing as OldEasing,\n  // @ts-ignore\n  EasingNode,\n} from 'react-native-reanimated';\nimport memoize from './memoize';\n\nimport {\n  Layout,\n  NavigationState,\n  Route,\n  Listener,\n  PagerCommonProps,\n  EventEmitterProps,\n} from './types';\n\ntype Binary = 0 | 1;\n\nconst Easing = EasingNode || OldEasing;\n\nexport type Props<T extends Route> = PagerCommonProps & {\n  onIndexChange: (index: number) => void;\n  navigationState: NavigationState<T>;\n  layout: Layout;\n  // Clip unfocused views to improve memory usage\n  // Don't enable this on iOS where this is buggy and views don't re-appear\n  removeClippedSubviews?: boolean;\n  children: (\n    props: EventEmitterProps & {\n      // Animated value which represents the state of current index\n      // It can include fractional digits as it represents the intermediate value\n      position: Animated.Node<number>;\n      // Function to actually render the content of the pager\n      // The parent component takes care of rendering\n      render: (children: React.ReactNode) => React.ReactNode;\n      // Callback to call when switching the tab\n      // The tab switch animation is performed even if the index in state is unchanged\n      jumpTo: (key: string) => void;\n    }\n  ) => React.ReactNode;\n  gestureHandlerProps: React.ComponentProps<typeof PanGestureHandler>;\n};\n\ntype ComponentState = {\n  enabled: boolean;\n  childPanGestureHandlerRefs: React.RefObject<PanGestureHandler>[];\n};\n\nconst {\n  Clock,\n  Value,\n  onChange,\n  and,\n  or,\n  abs,\n  add,\n  block,\n  call,\n  ceil,\n  clockRunning,\n  cond,\n  divide,\n  eq,\n  event,\n  floor,\n  greaterThan,\n  lessThan,\n  max,\n  min,\n  multiply,\n  neq,\n  not,\n  round,\n  set,\n  spring,\n  startClock,\n  stopClock,\n  sub,\n  timing,\n} = Animated;\n\nconst PagerContext = React.createContext({});\n\nconst TRUE = 1;\nconst FALSE = 0;\nconst NOOP = 0;\nconst UNSET = -1;\n\nconst DIRECTION_LEFT = 1;\nconst DIRECTION_RIGHT = -1;\n\nconst SWIPE_DISTANCE_MINIMUM = 20;\n\nconst SWIPE_VELOCITY_IMPACT = 0.2;\n\nconst SPRING_CONFIG = {\n  stiffness: 1000,\n  damping: 500,\n  mass: 3,\n  overshootClamping: true,\n  restDisplacementThreshold: 0.01,\n  restSpeedThreshold: 0.01,\n};\n\nconst SPRING_VELOCITY_SCALE = 1;\n\nconst TIMING_CONFIG = {\n  duration: 200,\n  easing: Easing.out(Easing.cubic),\n};\n\nexport default class Pager<T extends Route> extends React.Component<\n  Props<T>,\n  ComponentState\n> {\n  static defaultProps = {\n    swipeVelocityImpact: SWIPE_VELOCITY_IMPACT,\n    springVelocityScale: SPRING_VELOCITY_SCALE,\n  };\n\n  state = {\n    enabled: true,\n    childPanGestureHandlerRefs: [] as React.RefObject<PanGestureHandler>[],\n  };\n\n  componentDidMount() {\n    this.mounted = true;\n\n    // Register this PanGestureHandler with the parent (if parent exists)\n    // in order to coordinate gestures between handlers.\n    if (this.context && this.context.addGestureHandlerRef) {\n      this.context.addGestureHandlerRef(this.gestureHandlerRef);\n    }\n  }\n\n  componentDidUpdate(prevProps: Props<T>) {\n    const {\n      navigationState,\n      layout,\n      swipeVelocityImpact,\n      springVelocityScale,\n      springConfig,\n      timingConfig,\n    } = this.props;\n    const { index, routes } = navigationState;\n\n    if (\n      // Check for index in state to avoid unintended transition if component updates during swipe\n      (index !== prevProps.navigationState.index &&\n        index !== this.currentIndexValue) ||\n      // Check if the user updated the index correctly after an update\n      (typeof this.pendingIndexValue === 'number' &&\n        index !== this.pendingIndexValue)\n    ) {\n      // Index in user's state is different from the index being tracked\n      this.jumpToIndex(index);\n    }\n\n    // Reset the pending index\n    this.pendingIndexValue = undefined;\n\n    // Update our mappings of animated nodes when props change\n    if (prevProps.navigationState.routes.length !== routes.length) {\n      this.routesLength.setValue(routes.length);\n    }\n\n    if (prevProps.layout.width !== layout.width) {\n      this.progress.setValue(-index * layout.width);\n      this.layoutWidth.setValue(layout.width);\n    }\n\n    if (prevProps.swipeVelocityImpact !== swipeVelocityImpact) {\n      this.swipeVelocityImpact.setValue(\n        swipeVelocityImpact !== undefined\n          ? swipeVelocityImpact\n          : SWIPE_VELOCITY_IMPACT\n      );\n    }\n\n    if (prevProps.springVelocityScale !== springVelocityScale) {\n      this.springVelocityScale.setValue(\n        springVelocityScale !== undefined\n          ? springVelocityScale\n          : SPRING_VELOCITY_SCALE\n      );\n    }\n\n    if (prevProps.springConfig !== springConfig) {\n      this.springConfig.damping.setValue(\n        springConfig.damping !== undefined\n          ? springConfig.damping\n          : SPRING_CONFIG.damping\n      );\n\n      this.springConfig.mass.setValue(\n        springConfig.mass !== undefined ? springConfig.mass : SPRING_CONFIG.mass\n      );\n\n      this.springConfig.stiffness.setValue(\n        springConfig.stiffness !== undefined\n          ? springConfig.stiffness\n          : SPRING_CONFIG.stiffness\n      );\n\n      this.springConfig.restSpeedThreshold.setValue(\n        springConfig.restSpeedThreshold !== undefined\n          ? springConfig.restSpeedThreshold\n          : SPRING_CONFIG.restSpeedThreshold\n      );\n\n      this.springConfig.restDisplacementThreshold.setValue(\n        springConfig.restDisplacementThreshold !== undefined\n          ? springConfig.restDisplacementThreshold\n          : SPRING_CONFIG.restDisplacementThreshold\n      );\n    }\n\n    if (prevProps.timingConfig !== timingConfig) {\n      this.timingConfig.duration.setValue(\n        timingConfig.duration !== undefined\n          ? timingConfig.duration\n          : TIMING_CONFIG.duration\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    this.mounted = false;\n\n    if (this.interactionHandle !== null) {\n      InteractionManager.clearInteractionHandle(this.interactionHandle);\n    }\n  }\n\n  mounted = false;\n\n  static contextType = PagerContext;\n\n  // Mechanism to add child PanGestureHandler refs in the case that this\n  // Pager is a parent to child Pagers. Allows for coordination between handlers\n  private providerVal = {\n    addGestureHandlerRef: (ref: React.RefObject<PanGestureHandler>) => {\n      if (\n        !this.state.childPanGestureHandlerRefs.includes(ref) &&\n        this.mounted\n      ) {\n        this.setState((prevState: ComponentState) => ({\n          childPanGestureHandlerRefs: [\n            ...prevState.childPanGestureHandlerRefs,\n            ref,\n          ],\n        }));\n      }\n    },\n  };\n\n  // PanGestureHandler ref used for coordination with parent handlers\n  private gestureHandlerRef: React.RefObject<\n    PanGestureHandler\n  > = React.createRef();\n\n  // Clock used for tab transition animations\n  private clock = new Clock();\n\n  // Current state of the gesture\n  private velocityX = new Value(0);\n  private gestureX = new Value(0);\n  private gestureState = new Value(State.UNDETERMINED);\n  private offsetX = new Value(0);\n\n  // Tracks current state of gesture handler enabled\n  private gesturesEnabled = new Value(1);\n\n  // Current progress of the page (translateX value)\n  private progress = new Value(\n    // Initial value is based on the index and page width\n    this.props.navigationState.index * this.props.layout.width * DIRECTION_RIGHT\n  );\n\n  // Initial index of the tabs\n  private index = new Value(this.props.navigationState.index);\n\n  // Next index of the tabs, updated for navigation from outside (tab press, state update)\n  private nextIndex: Animated.Value<number> = new Value(UNSET);\n\n  // Scene that was last entered\n  private lastEnteredIndex = new Value(this.props.navigationState.index);\n\n  // Whether the user is currently dragging the screen\n  private isSwiping: Animated.Value<Binary> = new Value(FALSE);\n\n  // Whether the update was due to swipe gesture\n  // This controls whether the transition will use a spring or timing animation\n  // Remember to set it before transition needs to occur\n  private isSwipeGesture: Animated.Value<Binary> = new Value(FALSE);\n\n  // Track the index value when a swipe gesture has ended\n  // This lets us know if a gesture end triggered a tab switch or not\n  private indexAtSwipeEnd: Animated.Value<number> = new Value(\n    this.props.navigationState.index\n  );\n\n  // Mappings to some prop values\n  // We use them in animation calculations, so we need live animated nodes\n  private routesLength = new Value(this.props.navigationState.routes.length);\n  private layoutWidth = new Value(this.props.layout.width);\n\n  // Determines how relevant is a velocity while calculating next position while swiping\n  private swipeVelocityImpact = new Value(\n    this.props.swipeVelocityImpact !== undefined\n      ? this.props.swipeVelocityImpact\n      : SWIPE_VELOCITY_IMPACT\n  );\n\n  private springVelocityScale = new Value(\n    this.props.springVelocityScale !== undefined\n      ? this.props.springVelocityScale\n      : SPRING_VELOCITY_SCALE\n  );\n\n  // The position value represent the position of the pager on a scale of 0 - routes.length-1\n  // It is calculated based on the translate value and layout width\n  // If we don't have the layout yet, we should return the current index\n  private position = cond(\n    this.layoutWidth,\n    divide(multiply(this.progress, -1), this.layoutWidth),\n    this.index\n  );\n\n  // Animation configuration\n  private springConfig = {\n    damping: new Value(\n      this.props.springConfig.damping !== undefined\n        ? this.props.springConfig.damping\n        : SPRING_CONFIG.damping\n    ),\n    mass: new Value(\n      this.props.springConfig.mass !== undefined\n        ? this.props.springConfig.mass\n        : SPRING_CONFIG.mass\n    ),\n    stiffness: new Value(\n      this.props.springConfig.stiffness !== undefined\n        ? this.props.springConfig.stiffness\n        : SPRING_CONFIG.stiffness\n    ),\n    restSpeedThreshold: new Value(\n      this.props.springConfig.restSpeedThreshold !== undefined\n        ? this.props.springConfig.restSpeedThreshold\n        : SPRING_CONFIG.restSpeedThreshold\n    ),\n    restDisplacementThreshold: new Value(\n      this.props.springConfig.restDisplacementThreshold !== undefined\n        ? this.props.springConfig.restDisplacementThreshold\n        : SPRING_CONFIG.restDisplacementThreshold\n    ),\n  };\n\n  private timingConfig = {\n    duration: new Value(\n      this.props.timingConfig.duration !== undefined\n        ? this.props.timingConfig.duration\n        : TIMING_CONFIG.duration\n    ),\n  };\n\n  // The reason for using this value instead of simply passing `this._velocity`\n  // into a spring animation is that we need to reverse it if we're using RTL mode.\n  // Also, it's not possible to pass multiplied value there, because\n  // value passed to STATE of spring (the first argument) has to be Animated.Value\n  // and it's not allowed to pass other nodes there. The result of multiplying is not an\n  // Animated.Value. So this value is being updated on each start of spring animation.\n  private initialVelocityForSpring = new Value(0);\n\n  // The current index change caused by the pager's animation\n  // The pager is used as a controlled component\n  // We need to keep track of the index to determine when to trigger animation\n  // The state will change at various points, we should only respond when we are out of sync\n  // This will ensure smoother animation and avoid weird glitches\n  private currentIndexValue = this.props.navigationState.index;\n\n  // The pending index value as result of state update caused by swipe gesture\n  // We need to set it when state changes from inside this component\n  // It also needs to be reset right after componentDidUpdate fires\n  private pendingIndexValue: number | undefined = undefined;\n\n  // Numeric id of the previously focused text input\n  // When a gesture didn't change the tab, we can restore the focused input with this\n  private previouslyFocusedTextInput: number | null = null;\n\n  // Listeners for the entered screen\n  private enterListeners: Listener[] = [];\n\n  // InteractionHandle to handle tasks around animations\n  private interactionHandle: number | null = null;\n\n  private jumpToIndex = (index: number) => {\n    // If the index changed, we need to trigger a tab switch\n    this.isSwipeGesture.setValue(FALSE);\n    this.nextIndex.setValue(index);\n  };\n\n  private jumpTo = (key: string) => {\n    const { navigationState, keyboardDismissMode, onIndexChange } = this.props;\n\n    const index = navigationState.routes.findIndex(\n      (route) => route.key === key\n    );\n\n    // A tab switch might occur when we're in the middle of a transition\n    // In that case, the index might be same as before\n    // So we conditionally make the pager to update the position\n    if (navigationState.index === index) {\n      this.jumpToIndex(index);\n    } else {\n      onIndexChange(index);\n\n      // When the index changes, the focused input will no longer be in current tab\n      // So we should dismiss the keyboard\n      if (keyboardDismissMode === 'auto') {\n        Keyboard.dismiss();\n      }\n    }\n  };\n\n  private addListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter':\n        this.enterListeners.push(listener);\n        break;\n    }\n  };\n\n  private removeListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter': {\n        const index = this.enterListeners.indexOf(listener);\n\n        if (index > -1) {\n          this.enterListeners.splice(index, 1);\n        }\n\n        break;\n      }\n    }\n  };\n\n  private handleEnteredIndexChange = ([value]: readonly number[]) => {\n    const index = Math.max(\n      0,\n      Math.min(value, this.props.navigationState.routes.length - 1)\n    );\n\n    this.enterListeners.forEach((listener) => listener(index));\n  };\n\n  private transitionTo = (index: Animated.Node<number>) => {\n    const toValue = new Value(0);\n    const frameTime = new Value(0);\n\n    const state = {\n      position: this.progress,\n      time: new Value(0),\n      finished: new Value(FALSE),\n    };\n\n    return block([\n      cond(clockRunning(this.clock), NOOP, [\n        // Animation wasn't running before\n        // Set the initial values and start the clock\n        set(toValue, multiply(index, this.layoutWidth, DIRECTION_RIGHT)),\n        set(frameTime, 0),\n        set(state.time, 0),\n        set(state.finished, FALSE),\n        set(this.index, index),\n      ]),\n      cond(\n        this.isSwipeGesture,\n        // Animate the values with a spring for swipe\n        [\n          cond(\n            not(clockRunning(this.clock)),\n            I18nManager.isRTL\n              ? set(\n                  this.initialVelocityForSpring,\n                  multiply(-1, this.velocityX, this.springVelocityScale)\n                )\n              : set(\n                  this.initialVelocityForSpring,\n                  multiply(this.velocityX, this.springVelocityScale)\n                )\n          ),\n          spring(\n            this.clock,\n            { ...state, velocity: this.initialVelocityForSpring },\n            { ...SPRING_CONFIG, ...this.springConfig, toValue }\n          ),\n        ],\n        // Otherwise use a timing animation for faster switching\n        timing(\n          this.clock,\n          { ...state, frameTime },\n          { ...TIMING_CONFIG, ...this.timingConfig, toValue }\n        )\n      ),\n      cond(not(clockRunning(this.clock)), startClock(this.clock)),\n      cond(state.finished, [\n        // Reset values\n        set(this.isSwipeGesture, FALSE),\n        set(this.gestureX, 0),\n        set(this.velocityX, 0),\n        // When the animation finishes, stop the clock\n        stopClock(this.clock),\n      ]),\n    ]);\n  };\n\n  private handleGestureEvent = event([\n    {\n      nativeEvent: {\n        translationX: this.gestureX,\n        velocityX: this.velocityX,\n        state: this.gestureState,\n      },\n    },\n  ]);\n\n  private extrapolatedPosition = add(\n    this.gestureX,\n    multiply(this.velocityX, this.swipeVelocityImpact)\n  );\n\n  private toggleEnabled = () => {\n    if (this.state.enabled && this.mounted)\n      this.setState({ enabled: false }, () => {\n        this.setState({ enabled: true });\n      });\n  };\n\n  // Cancel gesture if swiping back from the initial tab or forward from the last tab.\n  // Enables parent Pager to pick up the gesture if one exists.\n  private maybeCancel = block([\n    cond(\n      and(\n        this.gesturesEnabled,\n        or(\n          and(\n            eq(this.index, sub(this.routesLength, 1)),\n            lessThan(this.gestureX, 0)\n          ),\n          and(eq(this.index, 0), greaterThan(this.gestureX, 0))\n        )\n      ),\n      set(this.gesturesEnabled, 0)\n    ),\n  ]);\n\n  private translateX = block([\n    onChange(\n      this.gesturesEnabled,\n      cond(\n        not(this.gesturesEnabled),\n        call([this.gesturesEnabled], this.toggleEnabled)\n      )\n    ),\n    onChange(\n      this.index,\n      call([this.index], ([value]) => {\n        this.currentIndexValue = value;\n        // Without this check, the pager can go to an infinite update <-> animate loop for sync updates\n        if (value !== this.props.navigationState.index) {\n          // If the index changed, and previous animation has finished, update state\n          this.props.onIndexChange(value);\n\n          this.pendingIndexValue = value;\n\n          // Force componentDidUpdate to fire, whether user does a setState or not\n          // This allows us to detect when the user drops the update and revert back\n          // It's necessary to make sure that the state stays in sync\n          if (this.mounted) {\n            this.forceUpdate();\n          }\n        }\n      })\n    ),\n    onChange(\n      this.position,\n      // Listen to updates in the position to detect when we enter a screen\n      // This is useful for things such as lazy loading when index change will fire too late\n      cond(\n        I18nManager.isRTL\n          ? lessThan(this.gestureX, 0)\n          : greaterThan(this.gestureX, 0),\n        // Based on the direction of the gesture, determine if we're entering the previous or next screen\n        cond(neq(floor(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, floor(this.position)),\n          call([floor(this.position)], this.handleEnteredIndexChange),\n        ]),\n        cond(neq(ceil(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, ceil(this.position)),\n          call([ceil(this.position)], this.handleEnteredIndexChange),\n        ])\n      )\n    ),\n    onChange(\n      this.isSwiping,\n      // Listen to updates for this value only when it changes\n      // Without `onChange`, this will fire even if the value didn't change\n      // We don't want to call the listeners if the value didn't change\n      [\n        cond(not(this.isSwiping), set(this.gesturesEnabled, 1)),\n        call(\n          [this.isSwiping, this.indexAtSwipeEnd, this.index],\n          ([isSwiping, indexAtSwipeEnd, currentIndex]: readonly number[]) => {\n            const {\n              keyboardDismissMode,\n              onSwipeStart,\n              onSwipeEnd,\n            } = this.props;\n\n            if (isSwiping === TRUE) {\n              onSwipeStart?.();\n              this.interactionHandle = InteractionManager.createInteractionHandle();\n\n              if (keyboardDismissMode === 'auto') {\n                // @ts-ignore: the method is only available in newer React Native, but types aren't up-to-date\n                const input = TextInput.State.currentlyFocusedInput\n                  ? // @ts-ignore\n                    TextInput.State.currentlyFocusedInput()\n                  : TextInput.State.currentlyFocusedField();\n\n                // When a gesture begins, blur the currently focused input\n                TextInput.State.blurTextInput(input);\n\n                // Store the id of this input so we can refocus it if gesture was cancelled\n                this.previouslyFocusedTextInput = input;\n              } else if (keyboardDismissMode === 'on-drag') {\n                Keyboard.dismiss();\n              }\n            } else {\n              onSwipeEnd?.();\n\n              if (this.interactionHandle !== null) {\n                InteractionManager.clearInteractionHandle(\n                  this.interactionHandle\n                );\n              }\n\n              if (keyboardDismissMode === 'auto') {\n                if (indexAtSwipeEnd === currentIndex) {\n                  // The index didn't change, we should restore the focus of text input\n                  const input = this.previouslyFocusedTextInput;\n\n                  if (input) {\n                    TextInput.State.focusTextInput(input);\n                  }\n                }\n\n                this.previouslyFocusedTextInput = null;\n              }\n            }\n          }\n        ),\n      ]\n    ),\n    onChange(\n      this.nextIndex,\n      cond(neq(this.nextIndex, UNSET), [\n        // Stop any running animations\n        cond(clockRunning(this.clock), stopClock(this.clock)),\n        set(this.gestureX, 0),\n        // Update the index to trigger the transition\n        set(this.index, this.nextIndex),\n        set(this.nextIndex, UNSET),\n      ])\n    ),\n    cond(\n      eq(this.gestureState, State.ACTIVE),\n      [\n        this.maybeCancel,\n        cond(this.isSwiping, NOOP, [\n          // We weren't dragging before, set it to true\n          set(this.isSwiping, TRUE),\n          set(this.isSwipeGesture, TRUE),\n          // Also update the drag offset to the last progress\n          set(this.offsetX, this.progress),\n        ]),\n        // Update progress with previous offset + gesture distance\n        set(\n          this.progress,\n          I18nManager.isRTL\n            ? sub(this.offsetX, this.gestureX)\n            : add(this.offsetX, this.gestureX)\n        ),\n        // Stop animations while we're dragging\n        stopClock(this.clock),\n      ],\n      [\n        set(this.isSwiping, FALSE),\n        set(this.indexAtSwipeEnd, this.index),\n        this.transitionTo(\n          cond(\n            and(\n              // We should consider velocity and gesture distance only when a swipe ends\n              // The gestureX value will be non-zero when swipe has happened\n              // We check against a minimum distance instead of 0 because `activeOffsetX` doesn't seem to be respected on Android\n              // For other factors such as state update, the velocity and gesture distance don't matter\n              greaterThan(abs(this.gestureX), SWIPE_DISTANCE_MINIMUM),\n              greaterThan(\n                abs(this.extrapolatedPosition),\n                divide(this.layoutWidth, 2)\n              )\n            ),\n            // For swipe gesture, to calculate the index, determine direction and add to index\n            // When the user swipes towards the left, we transition to the next tab\n            // When the user swipes towards the right, we transition to the previous tab\n            round(\n              min(\n                max(\n                  0,\n                  sub(\n                    this.index,\n                    cond(\n                      greaterThan(this.extrapolatedPosition, 0),\n                      I18nManager.isRTL ? DIRECTION_RIGHT : DIRECTION_LEFT,\n                      I18nManager.isRTL ? DIRECTION_LEFT : DIRECTION_RIGHT\n                    )\n                  )\n                ),\n                sub(this.routesLength, 1)\n              )\n            ),\n            // Index didn't change/changed due to state update\n            this.index\n          )\n        ),\n      ]\n    ),\n    this.progress,\n  ]);\n\n  private getTranslateX = memoize(\n    (\n      layoutWidth: Animated.Node<number>,\n      routesLength: Animated.Node<number>,\n      translateX: Animated.Node<number>\n    ) =>\n      multiply(\n        // Make sure that the translation doesn't exceed the bounds to prevent overscrolling\n        min(\n          max(\n            multiply(layoutWidth, sub(routesLength, 1), DIRECTION_RIGHT),\n            translateX\n          ),\n          0\n        ),\n        I18nManager.isRTL ? -1 : 1\n      )\n  );\n\n  render() {\n    const {\n      layout,\n      navigationState,\n      swipeEnabled,\n      children,\n      removeClippedSubviews,\n      gestureHandlerProps,\n    } = this.props;\n\n    const translateX = this.getTranslateX(\n      this.layoutWidth,\n      this.routesLength,\n      this.translateX\n    );\n\n    return children({\n      position: this.position,\n      addListener: this.addListener,\n      removeListener: this.removeListener,\n      jumpTo: this.jumpTo,\n      render: (children) => (\n        <PanGestureHandler\n          ref={this.gestureHandlerRef}\n          simultaneousHandlers={this.state.childPanGestureHandlerRefs}\n          waitFor={this.state.childPanGestureHandlerRefs}\n          enabled={layout.width !== 0 && swipeEnabled && this.state.enabled}\n          onGestureEvent={this.handleGestureEvent}\n          onHandlerStateChange={this.handleGestureEvent}\n          activeOffsetX={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          failOffsetY={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          {...gestureHandlerProps}\n        >\n          <Animated.View\n            removeClippedSubviews={removeClippedSubviews}\n            style={[\n              styles.container,\n              layout.width\n                ? {\n                    width: layout.width * navigationState.routes.length,\n                    transform: [{ translateX }] as any,\n                  }\n                : null,\n            ]}\n          >\n            <PagerContext.Provider value={this.providerVal}>\n              {children}\n            </PagerContext.Provider>\n          </Animated.View>\n        </PanGestureHandler>\n      ),\n    });\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    flexDirection: 'row',\n  },\n});\n"]}
\ No newline at end of file
+{"version":3,"sources":["Pager.tsx"],"names":["Easing","EasingNode","OldEasing","Clock","Value","onChange","and","or","abs","add","block","call","ceil","clockRunning","cond","divide","eq","event","floor","greaterThan","lessThan","max","min","multiply","neq","not","round","set","spring","startClock","stopClock","sub","timing","Animated","PagerContext","React","createContext","TRUE","FALSE","NOOP","UNSET","DIRECTION_LEFT","DIRECTION_RIGHT","SWIPE_DISTANCE_MINIMUM","SWIPE_VELOCITY_IMPACT","SPRING_CONFIG","stiffness","damping","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","SPRING_VELOCITY_SCALE","TIMING_CONFIG","duration","easing","out","cubic","Pager","Component","enabled","childPanGestureHandlerRefs","addGestureHandlerRef","ref","state","includes","mounted","setState","prevState","createRef","State","UNDETERMINED","props","navigationState","index","layout","width","routes","length","swipeVelocityImpact","undefined","springVelocityScale","layoutWidth","progress","springConfig","timingConfig","isSwipeGesture","setValue","nextIndex","key","keyboardDismissMode","findIndex","route","jumpToIndex","requestAnimationFrame","Keyboard","dismiss","type","listener","enterListeners","push","indexOf","splice","value","Math","forEach","toValue","frameTime","position","time","finished","clock","I18nManager","isRTL","initialVelocityForSpring","velocityX","velocity","gestureX","nativeEvent","translationX","gestureState","gesturesEnabled","routesLength","toggleEnabled","currentIndexValue","onIndexChange","pendingIndexValue","forceUpdate","lastEnteredIndex","handleEnteredIndexChange","isSwiping","indexAtSwipeEnd","currentIndex","onSwipeStart","onSwipeEnd","interactionHandle","InteractionManager","createInteractionHandle","input","TextInput","currentlyFocusedInput","currentlyFocusedField","blurTextInput","previouslyFocusedTextInput","clearInteractionHandle","focusTextInput","ACTIVE","maybeCancel","offsetX","transitionTo","extrapolatedPosition","translateX","componentDidMount","context","gestureHandlerRef","componentDidUpdate","prevProps","componentWillUnmount","render","swipeEnabled","children","removeClippedSubviews","gestureHandlerProps","getTranslateX","addListener","removeListener","jumpTo","handleGestureEvent","styles","container","transform","providerVal","StyleSheet","create","flex","flexDirection"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;AACA;;AAKA;;;;;;;;;;;;;;;;AAaA,MAAM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CACLO,MAAM,CAACC,SADF,EAEL9F,MAAM,CAACC,KAAP,GACI;AACEA,UAAAA,KAAK,EAAED,MAAM,CAACC,KAAP,GAAeH,eAAe,CAACI,MAAhB,CAAuBC,MAD/C;AAEE4F,UAAAA,SAAS,EAAE,CAAC;AAAEnB,YAAAA;AAAF,WAAD;AAFb,SADJ,GAKI,IAPC;AAFT,sBAYE,oBAAC,YAAD,CAAc,QAAd;AAAuB,QAAA,KAAK,EAAE,KAAKoB;AAAnC,SACGX,QADH,CAZF,CAXF;AANY,KAAD,CAAf;AAoCD;;AAzrBD;;;;gBAHmBtG,K,kBAIG;AACpBqB,EAAAA,mBAAmB,EAAEnC,qBADD;AAEpBqC,EAAAA,mBAAmB,EAAE7B;AAFD,C;;gBAJHM,K,iBA6HExB,Y;;AAkkBvB,MAAMsI,MAAM,GAAGI,wBAAWC,MAAX,CAAkB;AAC/BJ,EAAAA,SAAS,EAAE;AACTK,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,aAAa,EAAE;AAFN;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n  StyleSheet,\n  TextInput,\n  Keyboard,\n  I18nManager,\n  InteractionManager,\n} from 'react-native';\nimport { PanGestureHandler, State } from 'react-native-gesture-handler';\nimport Animated, {\n  Easing as OldEasing,\n  // @ts-ignore\n  EasingNode,\n} from 'react-native-reanimated';\nimport memoize from './memoize';\n\nimport {\n  Layout,\n  NavigationState,\n  Route,\n  Listener,\n  PagerCommonProps,\n  EventEmitterProps,\n} from './types';\n\ntype Binary = 0 | 1;\n\nconst Easing = EasingNode || OldEasing;\n\nexport type Props<T extends Route> = PagerCommonProps & {\n  onIndexChange: (index: number) => void;\n  navigationState: NavigationState<T>;\n  layout: Layout;\n  // Clip unfocused views to improve memory usage\n  // Don't enable this on iOS where this is buggy and views don't re-appear\n  removeClippedSubviews?: boolean;\n  children: (\n    props: EventEmitterProps & {\n      // Animated value which represents the state of current index\n      // It can include fractional digits as it represents the intermediate value\n      position: Animated.Node<number>;\n      // Function to actually render the content of the pager\n      // The parent component takes care of rendering\n      render: (children: React.ReactNode) => React.ReactNode;\n      // Callback to call when switching the tab\n      // The tab switch animation is performed even if the index in state is unchanged\n      jumpTo: (key: string) => void;\n    }\n  ) => React.ReactNode;\n  gestureHandlerProps: React.ComponentProps<typeof PanGestureHandler>;\n};\n\ntype ComponentState = {\n  enabled: boolean;\n  childPanGestureHandlerRefs: React.RefObject<PanGestureHandler>[];\n};\n\nconst {\n  Clock,\n  Value,\n  onChange,\n  and,\n  or,\n  abs,\n  add,\n  block,\n  call,\n  ceil,\n  clockRunning,\n  cond,\n  divide,\n  eq,\n  event,\n  floor,\n  greaterThan,\n  lessThan,\n  max,\n  min,\n  multiply,\n  neq,\n  not,\n  round,\n  set,\n  spring,\n  startClock,\n  stopClock,\n  sub,\n  timing,\n} = Animated;\n\nconst PagerContext = React.createContext({});\n\nconst TRUE = 1;\nconst FALSE = 0;\nconst NOOP = 0;\nconst UNSET = -1;\n\nconst DIRECTION_LEFT = 1;\nconst DIRECTION_RIGHT = -1;\n\nconst SWIPE_DISTANCE_MINIMUM = 20;\n\nconst SWIPE_VELOCITY_IMPACT = 0.2;\n\nconst SPRING_CONFIG = {\n  stiffness: 1000,\n  damping: 500,\n  mass: 3,\n  overshootClamping: true,\n  restDisplacementThreshold: 0.01,\n  restSpeedThreshold: 0.01,\n};\n\nconst SPRING_VELOCITY_SCALE = 1;\n\nconst TIMING_CONFIG = {\n  duration: 200,\n  easing: Easing.out(Easing.cubic),\n};\n\nexport default class Pager<T extends Route> extends React.Component<\n  Props<T>,\n  ComponentState\n> {\n  static defaultProps = {\n    swipeVelocityImpact: SWIPE_VELOCITY_IMPACT,\n    springVelocityScale: SPRING_VELOCITY_SCALE,\n  };\n\n  state = {\n    enabled: true,\n    childPanGestureHandlerRefs: [] as React.RefObject<PanGestureHandler>[],\n  };\n\n  componentDidMount() {\n    this.mounted = true;\n\n    // Register this PanGestureHandler with the parent (if parent exists)\n    // in order to coordinate gestures between handlers.\n    if (this.context && this.context.addGestureHandlerRef) {\n      this.context.addGestureHandlerRef(this.gestureHandlerRef);\n    }\n  }\n\n  componentDidUpdate(prevProps: Props<T>) {\n    const {\n      navigationState,\n      layout,\n      swipeVelocityImpact,\n      springVelocityScale,\n      springConfig,\n      timingConfig,\n    } = this.props;\n    const { index, routes } = navigationState;\n\n    if (\n      // Check for index in state to avoid unintended transition if component updates during swipe\n      (index !== prevProps.navigationState.index &&\n        index !== this.currentIndexValue) ||\n      // Check if the user updated the index correctly after an update\n      (typeof this.pendingIndexValue === 'number' &&\n        index !== this.pendingIndexValue)\n    ) {\n      // Index in user's state is different from the index being tracked\n      this.jumpToIndex(index);\n    }\n\n    // Reset the pending index\n    this.pendingIndexValue = undefined;\n\n    // Update our mappings of animated nodes when props change\n    if (prevProps.navigationState.routes.length !== routes.length) {\n      this.routesLength.setValue(routes.length);\n    }\n\n    if (prevProps.layout.width !== layout.width) {\n      this.progress.setValue(-index * layout.width);\n      this.layoutWidth.setValue(layout.width);\n    }\n\n    if (prevProps.swipeVelocityImpact !== swipeVelocityImpact) {\n      this.swipeVelocityImpact.setValue(\n        swipeVelocityImpact !== undefined\n          ? swipeVelocityImpact\n          : SWIPE_VELOCITY_IMPACT\n      );\n    }\n\n    if (prevProps.springVelocityScale !== springVelocityScale) {\n      this.springVelocityScale.setValue(\n        springVelocityScale !== undefined\n          ? springVelocityScale\n          : SPRING_VELOCITY_SCALE\n      );\n    }\n\n    if (prevProps.springConfig !== springConfig) {\n      this.springConfig.damping.setValue(\n        springConfig.damping !== undefined\n          ? springConfig.damping\n          : SPRING_CONFIG.damping\n      );\n\n      this.springConfig.mass.setValue(\n        springConfig.mass !== undefined ? springConfig.mass : SPRING_CONFIG.mass\n      );\n\n      this.springConfig.stiffness.setValue(\n        springConfig.stiffness !== undefined\n          ? springConfig.stiffness\n          : SPRING_CONFIG.stiffness\n      );\n\n      this.springConfig.restSpeedThreshold.setValue(\n        springConfig.restSpeedThreshold !== undefined\n          ? springConfig.restSpeedThreshold\n          : SPRING_CONFIG.restSpeedThreshold\n      );\n\n      this.springConfig.restDisplacementThreshold.setValue(\n        springConfig.restDisplacementThreshold !== undefined\n          ? springConfig.restDisplacementThreshold\n          : SPRING_CONFIG.restDisplacementThreshold\n      );\n    }\n\n    if (prevProps.timingConfig !== timingConfig) {\n      this.timingConfig.duration.setValue(\n        timingConfig.duration !== undefined\n          ? timingConfig.duration\n          : TIMING_CONFIG.duration\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    this.mounted = false;\n\n    if (this.interactionHandle !== null) {\n      InteractionManager.clearInteractionHandle(this.interactionHandle);\n    }\n  }\n\n  mounted = false;\n\n  static contextType = PagerContext;\n\n  // Mechanism to add child PanGestureHandler refs in the case that this\n  // Pager is a parent to child Pagers. Allows for coordination between handlers\n  private providerVal = {\n    addGestureHandlerRef: (ref: React.RefObject<PanGestureHandler>) => {\n      if (\n        !this.state.childPanGestureHandlerRefs.includes(ref) &&\n        this.mounted\n      ) {\n        this.setState((prevState: ComponentState) => ({\n          childPanGestureHandlerRefs: [\n            ...prevState.childPanGestureHandlerRefs,\n            ref,\n          ],\n        }));\n      }\n    },\n  };\n\n  // PanGestureHandler ref used for coordination with parent handlers\n  private gestureHandlerRef: React.RefObject<\n    PanGestureHandler\n  > = React.createRef();\n\n  // Clock used for tab transition animations\n  private clock = new Clock();\n\n  // Current state of the gesture\n  private velocityX = new Value(0);\n  private gestureX = new Value(0);\n  private gestureState = new Value(State.UNDETERMINED);\n  private offsetX = new Value(0);\n\n  // Tracks current state of gesture handler enabled\n  private gesturesEnabled = new Value(1);\n\n  // Current progress of the page (translateX value)\n  private progress = new Value(\n    // Initial value is based on the index and page width\n    this.props.navigationState.index * this.props.layout.width * DIRECTION_RIGHT\n  );\n\n  // Initial index of the tabs\n  private index = new Value(this.props.navigationState.index);\n\n  // Next index of the tabs, updated for navigation from outside (tab press, state update)\n  private nextIndex: Animated.Value<number> = new Value(UNSET);\n\n  // Scene that was last entered\n  private lastEnteredIndex = new Value(this.props.navigationState.index);\n\n  // Whether the user is currently dragging the screen\n  private isSwiping: Animated.Value<Binary> = new Value(FALSE);\n\n  // Whether the update was due to swipe gesture\n  // This controls whether the transition will use a spring or timing animation\n  // Remember to set it before transition needs to occur\n  private isSwipeGesture: Animated.Value<Binary> = new Value(FALSE);\n\n  // Track the index value when a swipe gesture has ended\n  // This lets us know if a gesture end triggered a tab switch or not\n  private indexAtSwipeEnd: Animated.Value<number> = new Value(\n    this.props.navigationState.index\n  );\n\n  // Mappings to some prop values\n  // We use them in animation calculations, so we need live animated nodes\n  private routesLength = new Value(this.props.navigationState.routes.length);\n  private layoutWidth = new Value(this.props.layout.width);\n\n  // Determines how relevant is a velocity while calculating next position while swiping\n  private swipeVelocityImpact = new Value(\n    this.props.swipeVelocityImpact !== undefined\n      ? this.props.swipeVelocityImpact\n      : SWIPE_VELOCITY_IMPACT\n  );\n\n  private springVelocityScale = new Value(\n    this.props.springVelocityScale !== undefined\n      ? this.props.springVelocityScale\n      : SPRING_VELOCITY_SCALE\n  );\n\n  // The position value represent the position of the pager on a scale of 0 - routes.length-1\n  // It is calculated based on the translate value and layout width\n  // If we don't have the layout yet, we should return the current index\n  private position = cond(\n    this.layoutWidth,\n    divide(multiply(this.progress, -1), this.layoutWidth),\n    this.index\n  );\n\n  // Animation configuration\n  private springConfig = {\n    damping: new Value(\n      this.props.springConfig.damping !== undefined\n        ? this.props.springConfig.damping\n        : SPRING_CONFIG.damping\n    ),\n    mass: new Value(\n      this.props.springConfig.mass !== undefined\n        ? this.props.springConfig.mass\n        : SPRING_CONFIG.mass\n    ),\n    stiffness: new Value(\n      this.props.springConfig.stiffness !== undefined\n        ? this.props.springConfig.stiffness\n        : SPRING_CONFIG.stiffness\n    ),\n    restSpeedThreshold: new Value(\n      this.props.springConfig.restSpeedThreshold !== undefined\n        ? this.props.springConfig.restSpeedThreshold\n        : SPRING_CONFIG.restSpeedThreshold\n    ),\n    restDisplacementThreshold: new Value(\n      this.props.springConfig.restDisplacementThreshold !== undefined\n        ? this.props.springConfig.restDisplacementThreshold\n        : SPRING_CONFIG.restDisplacementThreshold\n    ),\n  };\n\n  private timingConfig = {\n    duration: new Value(\n      this.props.timingConfig.duration !== undefined\n        ? this.props.timingConfig.duration\n        : TIMING_CONFIG.duration\n    ),\n  };\n\n  // The reason for using this value instead of simply passing `this._velocity`\n  // into a spring animation is that we need to reverse it if we're using RTL mode.\n  // Also, it's not possible to pass multiplied value there, because\n  // value passed to STATE of spring (the first argument) has to be Animated.Value\n  // and it's not allowed to pass other nodes there. The result of multiplying is not an\n  // Animated.Value. So this value is being updated on each start of spring animation.\n  private initialVelocityForSpring = new Value(0);\n\n  // The current index change caused by the pager's animation\n  // The pager is used as a controlled component\n  // We need to keep track of the index to determine when to trigger animation\n  // The state will change at various points, we should only respond when we are out of sync\n  // This will ensure smoother animation and avoid weird glitches\n  private currentIndexValue = this.props.navigationState.index;\n\n  // The pending index value as result of state update caused by swipe gesture\n  // We need to set it when state changes from inside this component\n  // It also needs to be reset right after componentDidUpdate fires\n  private pendingIndexValue: number | undefined = undefined;\n\n  // Numeric id of the previously focused text input\n  // When a gesture didn't change the tab, we can restore the focused input with this\n  private previouslyFocusedTextInput: number | null = null;\n\n  // Listeners for the entered screen\n  private enterListeners: Listener[] = [];\n\n  // InteractionHandle to handle tasks around animations\n  private interactionHandle: number | null = null;\n\n  private jumpToIndex = (index: number) => {\n    // If the index changed, we need to trigger a tab switch\n    this.isSwipeGesture.setValue(FALSE);\n    this.nextIndex.setValue(index);\n  };\n\n  private jumpTo = (key: string) => {\n    const { navigationState, keyboardDismissMode } = this.props;\n\n    const index = navigationState.routes.findIndex(\n      (route) => route.key === key\n    );\n\n    // A tab switch might occur when we're in the middle of a transition\n    // In that case, the index might be same as before\n    // So we conditionally make the pager to update the position\n    this.jumpToIndex(index);\n    if (navigationState.index !== index) {\n      requestAnimationFrame(() => {\n        // When the index changes, the focused input will no longer be in current tab\n        // So we should dismiss the keyboard\n        if (keyboardDismissMode === 'auto') {\n          Keyboard.dismiss();\n        }\n      });\n    }\n  };\n\n  private addListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter':\n        this.enterListeners.push(listener);\n        break;\n    }\n  };\n\n  private removeListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter': {\n        const index = this.enterListeners.indexOf(listener);\n\n        if (index > -1) {\n          this.enterListeners.splice(index, 1);\n        }\n\n        break;\n      }\n    }\n  };\n\n  private handleEnteredIndexChange = ([value]: readonly number[]) => {\n    const index = Math.max(\n      0,\n      Math.min(value, this.props.navigationState.routes.length - 1)\n    );\n\n    this.enterListeners.forEach((listener) => listener(index));\n  };\n\n  private transitionTo = (index: Animated.Node<number>) => {\n    const toValue = new Value(0);\n    const frameTime = new Value(0);\n\n    const state = {\n      position: this.progress,\n      time: new Value(0),\n      finished: new Value(FALSE),\n    };\n\n    return block([\n      cond(clockRunning(this.clock), NOOP, [\n        // Animation wasn't running before\n        // Set the initial values and start the clock\n        set(toValue, multiply(index, this.layoutWidth, DIRECTION_RIGHT)),\n        set(frameTime, 0),\n        set(state.time, 0),\n        set(state.finished, FALSE),\n        set(this.index, index),\n      ]),\n      cond(\n        this.isSwipeGesture,\n        // Animate the values with a spring for swipe\n        [\n          cond(\n            not(clockRunning(this.clock)),\n            I18nManager.isRTL\n              ? set(\n                  this.initialVelocityForSpring,\n                  multiply(-1, this.velocityX, this.springVelocityScale)\n                )\n              : set(\n                  this.initialVelocityForSpring,\n                  multiply(this.velocityX, this.springVelocityScale)\n                )\n          ),\n          spring(\n            this.clock,\n            { ...state, velocity: this.initialVelocityForSpring },\n            { ...SPRING_CONFIG, ...this.springConfig, toValue }\n          ),\n        ],\n        // Otherwise use a timing animation for faster switching\n        timing(\n          this.clock,\n          { ...state, frameTime },\n          { ...TIMING_CONFIG, ...this.timingConfig, toValue }\n        )\n      ),\n      cond(not(clockRunning(this.clock)), startClock(this.clock)),\n      cond(state.finished, [\n        // Reset values\n        set(this.isSwipeGesture, FALSE),\n        set(this.gestureX, 0),\n        set(this.velocityX, 0),\n        // When the animation finishes, stop the clock\n        stopClock(this.clock),\n      ]),\n    ]);\n  };\n\n  private handleGestureEvent = event([\n    {\n      nativeEvent: {\n        translationX: this.gestureX,\n        velocityX: this.velocityX,\n        state: this.gestureState,\n      },\n    },\n  ]);\n\n  private extrapolatedPosition = add(\n    this.gestureX,\n    multiply(this.velocityX, this.swipeVelocityImpact)\n  );\n\n  private toggleEnabled = () => {\n    if (this.state.enabled && this.mounted)\n      this.setState({ enabled: false }, () => {\n        this.setState({ enabled: true });\n      });\n  };\n\n  // Cancel gesture if swiping back from the initial tab or forward from the last tab.\n  // Enables parent Pager to pick up the gesture if one exists.\n  private maybeCancel = block([\n    cond(\n      and(\n        this.gesturesEnabled,\n        or(\n          and(\n            eq(this.index, sub(this.routesLength, 1)),\n            lessThan(this.gestureX, 0)\n          ),\n          and(eq(this.index, 0), greaterThan(this.gestureX, 0))\n        )\n      ),\n      set(this.gesturesEnabled, 0)\n    ),\n  ]);\n\n  private translateX = block([\n    onChange(\n      this.gesturesEnabled,\n      cond(\n        not(this.gesturesEnabled),\n        call([this.gesturesEnabled], this.toggleEnabled)\n      )\n    ),\n    onChange(\n      this.index,\n      call([this.index], ([value]) => {\n        this.currentIndexValue = value;\n        // Without this check, the pager can go to an infinite update <-> animate loop for sync updates\n        if (value !== this.props.navigationState.index) {\n          // If the index changed, and previous animation has finished, update state\n          this.props.onIndexChange(value);\n\n          this.pendingIndexValue = value;\n\n          // Force componentDidUpdate to fire, whether user does a setState or not\n          // This allows us to detect when the user drops the update and revert back\n          // It's necessary to make sure that the state stays in sync\n          if (this.mounted) {\n            this.forceUpdate();\n          }\n        }\n      })\n    ),\n    onChange(\n      this.position,\n      // Listen to updates in the position to detect when we enter a screen\n      // This is useful for things such as lazy loading when index change will fire too late\n      cond(\n        I18nManager.isRTL\n          ? lessThan(this.gestureX, 0)\n          : greaterThan(this.gestureX, 0),\n        // Based on the direction of the gesture, determine if we're entering the previous or next screen\n        cond(neq(floor(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, floor(this.position)),\n          call([floor(this.position)], this.handleEnteredIndexChange),\n        ]),\n        cond(neq(ceil(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, ceil(this.position)),\n          call([ceil(this.position)], this.handleEnteredIndexChange),\n        ])\n      )\n    ),\n    onChange(\n      this.isSwiping,\n      // Listen to updates for this value only when it changes\n      // Without `onChange`, this will fire even if the value didn't change\n      // We don't want to call the listeners if the value didn't change\n      [\n        cond(not(this.isSwiping), set(this.gesturesEnabled, 1)),\n        call(\n          [this.isSwiping, this.indexAtSwipeEnd, this.index],\n          ([isSwiping, indexAtSwipeEnd, currentIndex]: readonly number[]) => {\n            const {\n              keyboardDismissMode,\n              onSwipeStart,\n              onSwipeEnd,\n            } = this.props;\n\n            if (isSwiping === TRUE) {\n              onSwipeStart?.();\n              this.interactionHandle = InteractionManager.createInteractionHandle();\n\n              if (keyboardDismissMode === 'auto') {\n                // @ts-ignore: the method is only available in newer React Native, but types aren't up-to-date\n                const input = TextInput.State.currentlyFocusedInput\n                  ? // @ts-ignore\n                    TextInput.State.currentlyFocusedInput()\n                  : TextInput.State.currentlyFocusedField();\n\n                // When a gesture begins, blur the currently focused input\n                TextInput.State.blurTextInput(input);\n\n                // Store the id of this input so we can refocus it if gesture was cancelled\n                this.previouslyFocusedTextInput = input;\n              } else if (keyboardDismissMode === 'on-drag') {\n                Keyboard.dismiss();\n              }\n            } else {\n              onSwipeEnd?.();\n\n              if (this.interactionHandle !== null) {\n                InteractionManager.clearInteractionHandle(\n                  this.interactionHandle\n                );\n              }\n\n              if (keyboardDismissMode === 'auto') {\n                if (indexAtSwipeEnd === currentIndex) {\n                  // The index didn't change, we should restore the focus of text input\n                  const input = this.previouslyFocusedTextInput;\n\n                  if (input) {\n                    TextInput.State.focusTextInput(input);\n                  }\n                }\n\n                this.previouslyFocusedTextInput = null;\n              }\n            }\n          }\n        ),\n      ]\n    ),\n    onChange(\n      this.nextIndex,\n      cond(neq(this.nextIndex, UNSET), [\n        // Stop any running animations\n        cond(clockRunning(this.clock), stopClock(this.clock)),\n        set(this.gestureX, 0),\n        // Update the index to trigger the transition\n        set(this.index, this.nextIndex),\n        set(this.nextIndex, UNSET),\n      ])\n    ),\n    cond(\n      eq(this.gestureState, State.ACTIVE),\n      [\n        this.maybeCancel,\n        cond(this.isSwiping, NOOP, [\n          // We weren't dragging before, set it to true\n          set(this.isSwiping, TRUE),\n          set(this.isSwipeGesture, TRUE),\n          // Also update the drag offset to the last progress\n          set(this.offsetX, this.progress),\n        ]),\n        // Update progress with previous offset + gesture distance\n        set(\n          this.progress,\n          I18nManager.isRTL\n            ? sub(this.offsetX, this.gestureX)\n            : add(this.offsetX, this.gestureX)\n        ),\n        // Stop animations while we're dragging\n        stopClock(this.clock),\n      ],\n      [\n        set(this.isSwiping, FALSE),\n        set(this.indexAtSwipeEnd, this.index),\n        this.transitionTo(\n          cond(\n            and(\n              // We should consider velocity and gesture distance only when a swipe ends\n              // The gestureX value will be non-zero when swipe has happened\n              // We check against a minimum distance instead of 0 because `activeOffsetX` doesn't seem to be respected on Android\n              // For other factors such as state update, the velocity and gesture distance don't matter\n              greaterThan(abs(this.gestureX), SWIPE_DISTANCE_MINIMUM),\n              greaterThan(\n                abs(this.extrapolatedPosition),\n                divide(this.layoutWidth, 2)\n              )\n            ),\n            // For swipe gesture, to calculate the index, determine direction and add to index\n            // When the user swipes towards the left, we transition to the next tab\n            // When the user swipes towards the right, we transition to the previous tab\n            round(\n              min(\n                max(\n                  0,\n                  sub(\n                    this.index,\n                    cond(\n                      greaterThan(this.extrapolatedPosition, 0),\n                      I18nManager.isRTL ? DIRECTION_RIGHT : DIRECTION_LEFT,\n                      I18nManager.isRTL ? DIRECTION_LEFT : DIRECTION_RIGHT\n                    )\n                  )\n                ),\n                sub(this.routesLength, 1)\n              )\n            ),\n            // Index didn't change/changed due to state update\n            this.index\n          )\n        ),\n      ]\n    ),\n    this.progress,\n  ]);\n\n  private getTranslateX = memoize(\n    (\n      layoutWidth: Animated.Node<number>,\n      routesLength: Animated.Node<number>,\n      translateX: Animated.Node<number>\n    ) =>\n      multiply(\n        // Make sure that the translation doesn't exceed the bounds to prevent overscrolling\n        min(\n          max(\n            multiply(layoutWidth, sub(routesLength, 1), DIRECTION_RIGHT),\n            translateX\n          ),\n          0\n        ),\n        I18nManager.isRTL ? -1 : 1\n      )\n  );\n\n  render() {\n    const {\n      layout,\n      navigationState,\n      swipeEnabled,\n      children,\n      removeClippedSubviews,\n      gestureHandlerProps,\n    } = this.props;\n\n    const translateX = this.getTranslateX(\n      this.layoutWidth,\n      this.routesLength,\n      this.translateX\n    );\n\n    return children({\n      position: this.position,\n      addListener: this.addListener,\n      removeListener: this.removeListener,\n      jumpTo: this.jumpTo,\n      render: (children) => (\n        <PanGestureHandler\n          ref={this.gestureHandlerRef}\n          simultaneousHandlers={this.state.childPanGestureHandlerRefs}\n          waitFor={this.state.childPanGestureHandlerRefs}\n          enabled={layout.width !== 0 && swipeEnabled && this.state.enabled}\n          onGestureEvent={this.handleGestureEvent}\n          onHandlerStateChange={this.handleGestureEvent}\n          activeOffsetX={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          failOffsetY={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          {...gestureHandlerProps}\n        >\n          <Animated.View\n            removeClippedSubviews={removeClippedSubviews}\n            style={[\n              styles.container,\n              layout.width\n                ? {\n                    width: layout.width * navigationState.routes.length,\n                    transform: [{ translateX }] as any,\n                  }\n                : null,\n            ]}\n          >\n            <PagerContext.Provider value={this.providerVal}>\n              {children}\n            </PagerContext.Provider>\n          </Animated.View>\n        </PanGestureHandler>\n      ),\n    });\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    flexDirection: 'row',\n  },\n});\n"]}
\ No newline at end of file
diff --git a/node_modules/react-native-tab-view/lib/module/Pager.js b/node_modules/react-native-tab-view/lib/module/Pager.js
index 406e30a..5d8bc68 100644
--- a/node_modules/react-native-tab-view/lib/module/Pager.js
+++ b/node_modules/react-native-tab-view/lib/module/Pager.js
@@ -160,22 +160,22 @@ export default class Pager extends React.Component {
     _defineProperty(this, "jumpTo", key => {
       const {
         navigationState,
-        keyboardDismissMode,
-        onIndexChange
+        keyboardDismissMode
       } = this.props;
       const index = navigationState.routes.findIndex(route => route.key === key); // A tab switch might occur when we're in the middle of a transition
       // In that case, the index might be same as before
       // So we conditionally make the pager to update the position
 
-      if (navigationState.index === index) {
-        this.jumpToIndex(index);
-      } else {
-        onIndexChange(index); // When the index changes, the focused input will no longer be in current tab
-        // So we should dismiss the keyboard
+      this.jumpToIndex(index);
 
-        if (keyboardDismissMode === 'auto') {
-          Keyboard.dismiss();
-        }
+      if (navigationState.index !== index) {
+        requestAnimationFrame(() => {
+          // When the index changes, the focused input will no longer be in current tab
+          // So we should dismiss the keyboard
+          if (keyboardDismissMode === 'auto') {
+            Keyboard.dismiss();
+          }
+        });
       }
     });
 
diff --git a/node_modules/react-native-tab-view/lib/module/Pager.js.map b/node_modules/react-native-tab-view/lib/module/Pager.js.map
index 48b68f8..66cdd00 100644
--- a/node_modules/react-native-tab-view/lib/module/Pager.js.map
+++ b/node_modules/react-native-tab-view/lib/module/Pager.js.map
@@ -1 +1 @@
-{"version":3,"sources":["Pager.tsx"],"names":["React","StyleSheet","TextInput","Keyboard","I18nManager","InteractionManager","PanGestureHandler","State","Animated","Easing","OldEasing","EasingNode","memoize","Clock","Value","onChange","and","or","abs","add","block","call","ceil","clockRunning","cond","divide","eq","event","floor","greaterThan","lessThan","max","min","multiply","neq","not","round","set","spring","startClock","stopClock","sub","timing","PagerContext","createContext","TRUE","FALSE","NOOP","UNSET","DIRECTION_LEFT","DIRECTION_RIGHT","SWIPE_DISTANCE_MINIMUM","SWIPE_VELOCITY_IMPACT","SPRING_CONFIG","stiffness","damping","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","SPRING_VELOCITY_SCALE","TIMING_CONFIG","duration","easing","out","cubic","Pager","Component","enabled","childPanGestureHandlerRefs","addGestureHandlerRef","ref","state","includes","mounted","setState","prevState","createRef","UNDETERMINED","props","navigationState","index","layout","width","routes","length","swipeVelocityImpact","undefined","springVelocityScale","layoutWidth","progress","springConfig","timingConfig","isSwipeGesture","setValue","nextIndex","key","keyboardDismissMode","onIndexChange","findIndex","route","jumpToIndex","dismiss","type","listener","enterListeners","push","indexOf","splice","value","Math","forEach","toValue","frameTime","position","time","finished","clock","isRTL","initialVelocityForSpring","velocityX","velocity","gestureX","nativeEvent","translationX","gestureState","gesturesEnabled","routesLength","toggleEnabled","currentIndexValue","pendingIndexValue","forceUpdate","lastEnteredIndex","handleEnteredIndexChange","isSwiping","indexAtSwipeEnd","currentIndex","onSwipeStart","onSwipeEnd","interactionHandle","createInteractionHandle","input","currentlyFocusedInput","currentlyFocusedField","blurTextInput","previouslyFocusedTextInput","clearInteractionHandle","focusTextInput","ACTIVE","maybeCancel","offsetX","transitionTo","extrapolatedPosition","translateX","componentDidMount","context","gestureHandlerRef","componentDidUpdate","prevProps","componentWillUnmount","render","swipeEnabled","children","removeClippedSubviews","gestureHandlerProps","getTranslateX","addListener","removeListener","jumpTo","handleGestureEvent","styles","container","transform","providerVal","create","flex","flexDirection"],"mappings":";;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,UADF,EAEEC,SAFF,EAGEC,QAHF,EAIEC,WAJF,EAKEC,kBALF,QAMO,cANP;AAOA,SAASC,iBAAT,EAA4BC,KAA5B,QAAyC,8BAAzC;AACA,OAAOC,QAAP,IACEC,MAAM,IAAIC,SADZ,CAEE;AAFF,EAGEC,UAHF,QAIO,yBAJP;AAKA,OAAOC,OAAP,MAAoB,WAApB;AAaA,MAAMH,MAAM,GAAGE,UAAU,IAAID,SAA7B;AA8BA,MAAM;AACJG,EAA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,CAAC,CAACA,sBAAF,EAA0BA,sBAA1B;AARf,SASMiH,mBATN,gBAWE,oBAAC,QAAD,CAAU,IAAV;AACE,QAAA,qBAAqB,EAAED,qBADzB;AAEE,QAAA,KAAK,EAAE,CACLO,MAAM,CAACC,SADF,EAELzF,MAAM,CAACC,KAAP,GACI;AACEA,UAAAA,KAAK,EAAED,MAAM,CAACC,KAAP,GAAeH,eAAe,CAACI,MAAhB,CAAuBC,MAD/C;AAEEuF,UAAAA,SAAS,EAAE,CAAC;AAAEnB,YAAAA;AAAF,WAAD;AAFb,SADJ,GAKI,IAPC;AAFT,sBAYE,oBAAC,YAAD,CAAc,QAAd;AAAuB,QAAA,KAAK,EAAE,KAAKoB;AAAnC,SACGX,QADH,CAZF,CAXF;AANY,KAAD,CAAf;AAoCD;;AA1rBD;;gBAHmBhG,K,kBAIG;AACpBoB,EAAAA,mBAAmB,EAAElC,qBADD;AAEpBoC,EAAAA,mBAAmB,EAAE5B;AAFD,C;;gBAJHM,K,iBA6HEvB,Y;;AAmkBvB,MAAM+H,MAAM,GAAGzK,UAAU,CAAC6K,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AACTI,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,aAAa,EAAE;AAFN;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n  StyleSheet,\n  TextInput,\n  Keyboard,\n  I18nManager,\n  InteractionManager,\n} from 'react-native';\nimport { PanGestureHandler, State } from 'react-native-gesture-handler';\nimport Animated, {\n  Easing as OldEasing,\n  // @ts-ignore\n  EasingNode,\n} from 'react-native-reanimated';\nimport memoize from './memoize';\n\nimport {\n  Layout,\n  NavigationState,\n  Route,\n  Listener,\n  PagerCommonProps,\n  EventEmitterProps,\n} from './types';\n\ntype Binary = 0 | 1;\n\nconst Easing = EasingNode || OldEasing;\n\nexport type Props<T extends Route> = PagerCommonProps & {\n  onIndexChange: (index: number) => void;\n  navigationState: NavigationState<T>;\n  layout: Layout;\n  // Clip unfocused views to improve memory usage\n  // Don't enable this on iOS where this is buggy and views don't re-appear\n  removeClippedSubviews?: boolean;\n  children: (\n    props: EventEmitterProps & {\n      // Animated value which represents the state of current index\n      // It can include fractional digits as it represents the intermediate value\n      position: Animated.Node<number>;\n      // Function to actually render the content of the pager\n      // The parent component takes care of rendering\n      render: (children: React.ReactNode) => React.ReactNode;\n      // Callback to call when switching the tab\n      // The tab switch animation is performed even if the index in state is unchanged\n      jumpTo: (key: string) => void;\n    }\n  ) => React.ReactNode;\n  gestureHandlerProps: React.ComponentProps<typeof PanGestureHandler>;\n};\n\ntype ComponentState = {\n  enabled: boolean;\n  childPanGestureHandlerRefs: React.RefObject<PanGestureHandler>[];\n};\n\nconst {\n  Clock,\n  Value,\n  onChange,\n  and,\n  or,\n  abs,\n  add,\n  block,\n  call,\n  ceil,\n  clockRunning,\n  cond,\n  divide,\n  eq,\n  event,\n  floor,\n  greaterThan,\n  lessThan,\n  max,\n  min,\n  multiply,\n  neq,\n  not,\n  round,\n  set,\n  spring,\n  startClock,\n  stopClock,\n  sub,\n  timing,\n} = Animated;\n\nconst PagerContext = React.createContext({});\n\nconst TRUE = 1;\nconst FALSE = 0;\nconst NOOP = 0;\nconst UNSET = -1;\n\nconst DIRECTION_LEFT = 1;\nconst DIRECTION_RIGHT = -1;\n\nconst SWIPE_DISTANCE_MINIMUM = 20;\n\nconst SWIPE_VELOCITY_IMPACT = 0.2;\n\nconst SPRING_CONFIG = {\n  stiffness: 1000,\n  damping: 500,\n  mass: 3,\n  overshootClamping: true,\n  restDisplacementThreshold: 0.01,\n  restSpeedThreshold: 0.01,\n};\n\nconst SPRING_VELOCITY_SCALE = 1;\n\nconst TIMING_CONFIG = {\n  duration: 200,\n  easing: Easing.out(Easing.cubic),\n};\n\nexport default class Pager<T extends Route> extends React.Component<\n  Props<T>,\n  ComponentState\n> {\n  static defaultProps = {\n    swipeVelocityImpact: SWIPE_VELOCITY_IMPACT,\n    springVelocityScale: SPRING_VELOCITY_SCALE,\n  };\n\n  state = {\n    enabled: true,\n    childPanGestureHandlerRefs: [] as React.RefObject<PanGestureHandler>[],\n  };\n\n  componentDidMount() {\n    this.mounted = true;\n\n    // Register this PanGestureHandler with the parent (if parent exists)\n    // in order to coordinate gestures between handlers.\n    if (this.context && this.context.addGestureHandlerRef) {\n      this.context.addGestureHandlerRef(this.gestureHandlerRef);\n    }\n  }\n\n  componentDidUpdate(prevProps: Props<T>) {\n    const {\n      navigationState,\n      layout,\n      swipeVelocityImpact,\n      springVelocityScale,\n      springConfig,\n      timingConfig,\n    } = this.props;\n    const { index, routes } = navigationState;\n\n    if (\n      // Check for index in state to avoid unintended transition if component updates during swipe\n      (index !== prevProps.navigationState.index &&\n        index !== this.currentIndexValue) ||\n      // Check if the user updated the index correctly after an update\n      (typeof this.pendingIndexValue === 'number' &&\n        index !== this.pendingIndexValue)\n    ) {\n      // Index in user's state is different from the index being tracked\n      this.jumpToIndex(index);\n    }\n\n    // Reset the pending index\n    this.pendingIndexValue = undefined;\n\n    // Update our mappings of animated nodes when props change\n    if (prevProps.navigationState.routes.length !== routes.length) {\n      this.routesLength.setValue(routes.length);\n    }\n\n    if (prevProps.layout.width !== layout.width) {\n      this.progress.setValue(-index * layout.width);\n      this.layoutWidth.setValue(layout.width);\n    }\n\n    if (prevProps.swipeVelocityImpact !== swipeVelocityImpact) {\n      this.swipeVelocityImpact.setValue(\n        swipeVelocityImpact !== undefined\n          ? swipeVelocityImpact\n          : SWIPE_VELOCITY_IMPACT\n      );\n    }\n\n    if (prevProps.springVelocityScale !== springVelocityScale) {\n      this.springVelocityScale.setValue(\n        springVelocityScale !== undefined\n          ? springVelocityScale\n          : SPRING_VELOCITY_SCALE\n      );\n    }\n\n    if (prevProps.springConfig !== springConfig) {\n      this.springConfig.damping.setValue(\n        springConfig.damping !== undefined\n          ? springConfig.damping\n          : SPRING_CONFIG.damping\n      );\n\n      this.springConfig.mass.setValue(\n        springConfig.mass !== undefined ? springConfig.mass : SPRING_CONFIG.mass\n      );\n\n      this.springConfig.stiffness.setValue(\n        springConfig.stiffness !== undefined\n          ? springConfig.stiffness\n          : SPRING_CONFIG.stiffness\n      );\n\n      this.springConfig.restSpeedThreshold.setValue(\n        springConfig.restSpeedThreshold !== undefined\n          ? springConfig.restSpeedThreshold\n          : SPRING_CONFIG.restSpeedThreshold\n      );\n\n      this.springConfig.restDisplacementThreshold.setValue(\n        springConfig.restDisplacementThreshold !== undefined\n          ? springConfig.restDisplacementThreshold\n          : SPRING_CONFIG.restDisplacementThreshold\n      );\n    }\n\n    if (prevProps.timingConfig !== timingConfig) {\n      this.timingConfig.duration.setValue(\n        timingConfig.duration !== undefined\n          ? timingConfig.duration\n          : TIMING_CONFIG.duration\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    this.mounted = false;\n\n    if (this.interactionHandle !== null) {\n      InteractionManager.clearInteractionHandle(this.interactionHandle);\n    }\n  }\n\n  mounted = false;\n\n  static contextType = PagerContext;\n\n  // Mechanism to add child PanGestureHandler refs in the case that this\n  // Pager is a parent to child Pagers. Allows for coordination between handlers\n  private providerVal = {\n    addGestureHandlerRef: (ref: React.RefObject<PanGestureHandler>) => {\n      if (\n        !this.state.childPanGestureHandlerRefs.includes(ref) &&\n        this.mounted\n      ) {\n        this.setState((prevState: ComponentState) => ({\n          childPanGestureHandlerRefs: [\n            ...prevState.childPanGestureHandlerRefs,\n            ref,\n          ],\n        }));\n      }\n    },\n  };\n\n  // PanGestureHandler ref used for coordination with parent handlers\n  private gestureHandlerRef: React.RefObject<\n    PanGestureHandler\n  > = React.createRef();\n\n  // Clock used for tab transition animations\n  private clock = new Clock();\n\n  // Current state of the gesture\n  private velocityX = new Value(0);\n  private gestureX = new Value(0);\n  private gestureState = new Value(State.UNDETERMINED);\n  private offsetX = new Value(0);\n\n  // Tracks current state of gesture handler enabled\n  private gesturesEnabled = new Value(1);\n\n  // Current progress of the page (translateX value)\n  private progress = new Value(\n    // Initial value is based on the index and page width\n    this.props.navigationState.index * this.props.layout.width * DIRECTION_RIGHT\n  );\n\n  // Initial index of the tabs\n  private index = new Value(this.props.navigationState.index);\n\n  // Next index of the tabs, updated for navigation from outside (tab press, state update)\n  private nextIndex: Animated.Value<number> = new Value(UNSET);\n\n  // Scene that was last entered\n  private lastEnteredIndex = new Value(this.props.navigationState.index);\n\n  // Whether the user is currently dragging the screen\n  private isSwiping: Animated.Value<Binary> = new Value(FALSE);\n\n  // Whether the update was due to swipe gesture\n  // This controls whether the transition will use a spring or timing animation\n  // Remember to set it before transition needs to occur\n  private isSwipeGesture: Animated.Value<Binary> = new Value(FALSE);\n\n  // Track the index value when a swipe gesture has ended\n  // This lets us know if a gesture end triggered a tab switch or not\n  private indexAtSwipeEnd: Animated.Value<number> = new Value(\n    this.props.navigationState.index\n  );\n\n  // Mappings to some prop values\n  // We use them in animation calculations, so we need live animated nodes\n  private routesLength = new Value(this.props.navigationState.routes.length);\n  private layoutWidth = new Value(this.props.layout.width);\n\n  // Determines how relevant is a velocity while calculating next position while swiping\n  private swipeVelocityImpact = new Value(\n    this.props.swipeVelocityImpact !== undefined\n      ? this.props.swipeVelocityImpact\n      : SWIPE_VELOCITY_IMPACT\n  );\n\n  private springVelocityScale = new Value(\n    this.props.springVelocityScale !== undefined\n      ? this.props.springVelocityScale\n      : SPRING_VELOCITY_SCALE\n  );\n\n  // The position value represent the position of the pager on a scale of 0 - routes.length-1\n  // It is calculated based on the translate value and layout width\n  // If we don't have the layout yet, we should return the current index\n  private position = cond(\n    this.layoutWidth,\n    divide(multiply(this.progress, -1), this.layoutWidth),\n    this.index\n  );\n\n  // Animation configuration\n  private springConfig = {\n    damping: new Value(\n      this.props.springConfig.damping !== undefined\n        ? this.props.springConfig.damping\n        : SPRING_CONFIG.damping\n    ),\n    mass: new Value(\n      this.props.springConfig.mass !== undefined\n        ? this.props.springConfig.mass\n        : SPRING_CONFIG.mass\n    ),\n    stiffness: new Value(\n      this.props.springConfig.stiffness !== undefined\n        ? this.props.springConfig.stiffness\n        : SPRING_CONFIG.stiffness\n    ),\n    restSpeedThreshold: new Value(\n      this.props.springConfig.restSpeedThreshold !== undefined\n        ? this.props.springConfig.restSpeedThreshold\n        : SPRING_CONFIG.restSpeedThreshold\n    ),\n    restDisplacementThreshold: new Value(\n      this.props.springConfig.restDisplacementThreshold !== undefined\n        ? this.props.springConfig.restDisplacementThreshold\n        : SPRING_CONFIG.restDisplacementThreshold\n    ),\n  };\n\n  private timingConfig = {\n    duration: new Value(\n      this.props.timingConfig.duration !== undefined\n        ? this.props.timingConfig.duration\n        : TIMING_CONFIG.duration\n    ),\n  };\n\n  // The reason for using this value instead of simply passing `this._velocity`\n  // into a spring animation is that we need to reverse it if we're using RTL mode.\n  // Also, it's not possible to pass multiplied value there, because\n  // value passed to STATE of spring (the first argument) has to be Animated.Value\n  // and it's not allowed to pass other nodes there. The result of multiplying is not an\n  // Animated.Value. So this value is being updated on each start of spring animation.\n  private initialVelocityForSpring = new Value(0);\n\n  // The current index change caused by the pager's animation\n  // The pager is used as a controlled component\n  // We need to keep track of the index to determine when to trigger animation\n  // The state will change at various points, we should only respond when we are out of sync\n  // This will ensure smoother animation and avoid weird glitches\n  private currentIndexValue = this.props.navigationState.index;\n\n  // The pending index value as result of state update caused by swipe gesture\n  // We need to set it when state changes from inside this component\n  // It also needs to be reset right after componentDidUpdate fires\n  private pendingIndexValue: number | undefined = undefined;\n\n  // Numeric id of the previously focused text input\n  // When a gesture didn't change the tab, we can restore the focused input with this\n  private previouslyFocusedTextInput: number | null = null;\n\n  // Listeners for the entered screen\n  private enterListeners: Listener[] = [];\n\n  // InteractionHandle to handle tasks around animations\n  private interactionHandle: number | null = null;\n\n  private jumpToIndex = (index: number) => {\n    // If the index changed, we need to trigger a tab switch\n    this.isSwipeGesture.setValue(FALSE);\n    this.nextIndex.setValue(index);\n  };\n\n  private jumpTo = (key: string) => {\n    const { navigationState, keyboardDismissMode, onIndexChange } = this.props;\n\n    const index = navigationState.routes.findIndex(\n      (route) => route.key === key\n    );\n\n    // A tab switch might occur when we're in the middle of a transition\n    // In that case, the index might be same as before\n    // So we conditionally make the pager to update the position\n    if (navigationState.index === index) {\n      this.jumpToIndex(index);\n    } else {\n      onIndexChange(index);\n\n      // When the index changes, the focused input will no longer be in current tab\n      // So we should dismiss the keyboard\n      if (keyboardDismissMode === 'auto') {\n        Keyboard.dismiss();\n      }\n    }\n  };\n\n  private addListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter':\n        this.enterListeners.push(listener);\n        break;\n    }\n  };\n\n  private removeListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter': {\n        const index = this.enterListeners.indexOf(listener);\n\n        if (index > -1) {\n          this.enterListeners.splice(index, 1);\n        }\n\n        break;\n      }\n    }\n  };\n\n  private handleEnteredIndexChange = ([value]: readonly number[]) => {\n    const index = Math.max(\n      0,\n      Math.min(value, this.props.navigationState.routes.length - 1)\n    );\n\n    this.enterListeners.forEach((listener) => listener(index));\n  };\n\n  private transitionTo = (index: Animated.Node<number>) => {\n    const toValue = new Value(0);\n    const frameTime = new Value(0);\n\n    const state = {\n      position: this.progress,\n      time: new Value(0),\n      finished: new Value(FALSE),\n    };\n\n    return block([\n      cond(clockRunning(this.clock), NOOP, [\n        // Animation wasn't running before\n        // Set the initial values and start the clock\n        set(toValue, multiply(index, this.layoutWidth, DIRECTION_RIGHT)),\n        set(frameTime, 0),\n        set(state.time, 0),\n        set(state.finished, FALSE),\n        set(this.index, index),\n      ]),\n      cond(\n        this.isSwipeGesture,\n        // Animate the values with a spring for swipe\n        [\n          cond(\n            not(clockRunning(this.clock)),\n            I18nManager.isRTL\n              ? set(\n                  this.initialVelocityForSpring,\n                  multiply(-1, this.velocityX, this.springVelocityScale)\n                )\n              : set(\n                  this.initialVelocityForSpring,\n                  multiply(this.velocityX, this.springVelocityScale)\n                )\n          ),\n          spring(\n            this.clock,\n            { ...state, velocity: this.initialVelocityForSpring },\n            { ...SPRING_CONFIG, ...this.springConfig, toValue }\n          ),\n        ],\n        // Otherwise use a timing animation for faster switching\n        timing(\n          this.clock,\n          { ...state, frameTime },\n          { ...TIMING_CONFIG, ...this.timingConfig, toValue }\n        )\n      ),\n      cond(not(clockRunning(this.clock)), startClock(this.clock)),\n      cond(state.finished, [\n        // Reset values\n        set(this.isSwipeGesture, FALSE),\n        set(this.gestureX, 0),\n        set(this.velocityX, 0),\n        // When the animation finishes, stop the clock\n        stopClock(this.clock),\n      ]),\n    ]);\n  };\n\n  private handleGestureEvent = event([\n    {\n      nativeEvent: {\n        translationX: this.gestureX,\n        velocityX: this.velocityX,\n        state: this.gestureState,\n      },\n    },\n  ]);\n\n  private extrapolatedPosition = add(\n    this.gestureX,\n    multiply(this.velocityX, this.swipeVelocityImpact)\n  );\n\n  private toggleEnabled = () => {\n    if (this.state.enabled && this.mounted)\n      this.setState({ enabled: false }, () => {\n        this.setState({ enabled: true });\n      });\n  };\n\n  // Cancel gesture if swiping back from the initial tab or forward from the last tab.\n  // Enables parent Pager to pick up the gesture if one exists.\n  private maybeCancel = block([\n    cond(\n      and(\n        this.gesturesEnabled,\n        or(\n          and(\n            eq(this.index, sub(this.routesLength, 1)),\n            lessThan(this.gestureX, 0)\n          ),\n          and(eq(this.index, 0), greaterThan(this.gestureX, 0))\n        )\n      ),\n      set(this.gesturesEnabled, 0)\n    ),\n  ]);\n\n  private translateX = block([\n    onChange(\n      this.gesturesEnabled,\n      cond(\n        not(this.gesturesEnabled),\n        call([this.gesturesEnabled], this.toggleEnabled)\n      )\n    ),\n    onChange(\n      this.index,\n      call([this.index], ([value]) => {\n        this.currentIndexValue = value;\n        // Without this check, the pager can go to an infinite update <-> animate loop for sync updates\n        if (value !== this.props.navigationState.index) {\n          // If the index changed, and previous animation has finished, update state\n          this.props.onIndexChange(value);\n\n          this.pendingIndexValue = value;\n\n          // Force componentDidUpdate to fire, whether user does a setState or not\n          // This allows us to detect when the user drops the update and revert back\n          // It's necessary to make sure that the state stays in sync\n          if (this.mounted) {\n            this.forceUpdate();\n          }\n        }\n      })\n    ),\n    onChange(\n      this.position,\n      // Listen to updates in the position to detect when we enter a screen\n      // This is useful for things such as lazy loading when index change will fire too late\n      cond(\n        I18nManager.isRTL\n          ? lessThan(this.gestureX, 0)\n          : greaterThan(this.gestureX, 0),\n        // Based on the direction of the gesture, determine if we're entering the previous or next screen\n        cond(neq(floor(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, floor(this.position)),\n          call([floor(this.position)], this.handleEnteredIndexChange),\n        ]),\n        cond(neq(ceil(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, ceil(this.position)),\n          call([ceil(this.position)], this.handleEnteredIndexChange),\n        ])\n      )\n    ),\n    onChange(\n      this.isSwiping,\n      // Listen to updates for this value only when it changes\n      // Without `onChange`, this will fire even if the value didn't change\n      // We don't want to call the listeners if the value didn't change\n      [\n        cond(not(this.isSwiping), set(this.gesturesEnabled, 1)),\n        call(\n          [this.isSwiping, this.indexAtSwipeEnd, this.index],\n          ([isSwiping, indexAtSwipeEnd, currentIndex]: readonly number[]) => {\n            const {\n              keyboardDismissMode,\n              onSwipeStart,\n              onSwipeEnd,\n            } = this.props;\n\n            if (isSwiping === TRUE) {\n              onSwipeStart?.();\n              this.interactionHandle = InteractionManager.createInteractionHandle();\n\n              if (keyboardDismissMode === 'auto') {\n                // @ts-ignore: the method is only available in newer React Native, but types aren't up-to-date\n                const input = TextInput.State.currentlyFocusedInput\n                  ? // @ts-ignore\n                    TextInput.State.currentlyFocusedInput()\n                  : TextInput.State.currentlyFocusedField();\n\n                // When a gesture begins, blur the currently focused input\n                TextInput.State.blurTextInput(input);\n\n                // Store the id of this input so we can refocus it if gesture was cancelled\n                this.previouslyFocusedTextInput = input;\n              } else if (keyboardDismissMode === 'on-drag') {\n                Keyboard.dismiss();\n              }\n            } else {\n              onSwipeEnd?.();\n\n              if (this.interactionHandle !== null) {\n                InteractionManager.clearInteractionHandle(\n                  this.interactionHandle\n                );\n              }\n\n              if (keyboardDismissMode === 'auto') {\n                if (indexAtSwipeEnd === currentIndex) {\n                  // The index didn't change, we should restore the focus of text input\n                  const input = this.previouslyFocusedTextInput;\n\n                  if (input) {\n                    TextInput.State.focusTextInput(input);\n                  }\n                }\n\n                this.previouslyFocusedTextInput = null;\n              }\n            }\n          }\n        ),\n      ]\n    ),\n    onChange(\n      this.nextIndex,\n      cond(neq(this.nextIndex, UNSET), [\n        // Stop any running animations\n        cond(clockRunning(this.clock), stopClock(this.clock)),\n        set(this.gestureX, 0),\n        // Update the index to trigger the transition\n        set(this.index, this.nextIndex),\n        set(this.nextIndex, UNSET),\n      ])\n    ),\n    cond(\n      eq(this.gestureState, State.ACTIVE),\n      [\n        this.maybeCancel,\n        cond(this.isSwiping, NOOP, [\n          // We weren't dragging before, set it to true\n          set(this.isSwiping, TRUE),\n          set(this.isSwipeGesture, TRUE),\n          // Also update the drag offset to the last progress\n          set(this.offsetX, this.progress),\n        ]),\n        // Update progress with previous offset + gesture distance\n        set(\n          this.progress,\n          I18nManager.isRTL\n            ? sub(this.offsetX, this.gestureX)\n            : add(this.offsetX, this.gestureX)\n        ),\n        // Stop animations while we're dragging\n        stopClock(this.clock),\n      ],\n      [\n        set(this.isSwiping, FALSE),\n        set(this.indexAtSwipeEnd, this.index),\n        this.transitionTo(\n          cond(\n            and(\n              // We should consider velocity and gesture distance only when a swipe ends\n              // The gestureX value will be non-zero when swipe has happened\n              // We check against a minimum distance instead of 0 because `activeOffsetX` doesn't seem to be respected on Android\n              // For other factors such as state update, the velocity and gesture distance don't matter\n              greaterThan(abs(this.gestureX), SWIPE_DISTANCE_MINIMUM),\n              greaterThan(\n                abs(this.extrapolatedPosition),\n                divide(this.layoutWidth, 2)\n              )\n            ),\n            // For swipe gesture, to calculate the index, determine direction and add to index\n            // When the user swipes towards the left, we transition to the next tab\n            // When the user swipes towards the right, we transition to the previous tab\n            round(\n              min(\n                max(\n                  0,\n                  sub(\n                    this.index,\n                    cond(\n                      greaterThan(this.extrapolatedPosition, 0),\n                      I18nManager.isRTL ? DIRECTION_RIGHT : DIRECTION_LEFT,\n                      I18nManager.isRTL ? DIRECTION_LEFT : DIRECTION_RIGHT\n                    )\n                  )\n                ),\n                sub(this.routesLength, 1)\n              )\n            ),\n            // Index didn't change/changed due to state update\n            this.index\n          )\n        ),\n      ]\n    ),\n    this.progress,\n  ]);\n\n  private getTranslateX = memoize(\n    (\n      layoutWidth: Animated.Node<number>,\n      routesLength: Animated.Node<number>,\n      translateX: Animated.Node<number>\n    ) =>\n      multiply(\n        // Make sure that the translation doesn't exceed the bounds to prevent overscrolling\n        min(\n          max(\n            multiply(layoutWidth, sub(routesLength, 1), DIRECTION_RIGHT),\n            translateX\n          ),\n          0\n        ),\n        I18nManager.isRTL ? -1 : 1\n      )\n  );\n\n  render() {\n    const {\n      layout,\n      navigationState,\n      swipeEnabled,\n      children,\n      removeClippedSubviews,\n      gestureHandlerProps,\n    } = this.props;\n\n    const translateX = this.getTranslateX(\n      this.layoutWidth,\n      this.routesLength,\n      this.translateX\n    );\n\n    return children({\n      position: this.position,\n      addListener: this.addListener,\n      removeListener: this.removeListener,\n      jumpTo: this.jumpTo,\n      render: (children) => (\n        <PanGestureHandler\n          ref={this.gestureHandlerRef}\n          simultaneousHandlers={this.state.childPanGestureHandlerRefs}\n          waitFor={this.state.childPanGestureHandlerRefs}\n          enabled={layout.width !== 0 && swipeEnabled && this.state.enabled}\n          onGestureEvent={this.handleGestureEvent}\n          onHandlerStateChange={this.handleGestureEvent}\n          activeOffsetX={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          failOffsetY={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          {...gestureHandlerProps}\n        >\n          <Animated.View\n            removeClippedSubviews={removeClippedSubviews}\n            style={[\n              styles.container,\n              layout.width\n                ? {\n                    width: layout.width * navigationState.routes.length,\n                    transform: [{ translateX }] as any,\n                  }\n                : null,\n            ]}\n          >\n            <PagerContext.Provider value={this.providerVal}>\n              {children}\n            </PagerContext.Provider>\n          </Animated.View>\n        </PanGestureHandler>\n      ),\n    });\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    flexDirection: 'row',\n  },\n});\n"]}
\ No newline at end of file
+{"version":3,"sources":["Pager.tsx"],"names":["React","StyleSheet","TextInput","Keyboard","I18nManager","InteractionManager","PanGestureHandler","State","Animated","Easing","OldEasing","EasingNode","memoize","Clock","Value","onChange","and","or","abs","add","block","call","ceil","clockRunning","cond","divide","eq","event","floor","greaterThan","lessThan","max","min","multiply","neq","not","round","set","spring","startClock","stopClock","sub","timing","PagerContext","createContext","TRUE","FALSE","NOOP","UNSET","DIRECTION_LEFT","DIRECTION_RIGHT","SWIPE_DISTANCE_MINIMUM","SWIPE_VELOCITY_IMPACT","SPRING_CONFIG","stiffness","damping","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","SPRING_VELOCITY_SCALE","TIMING_CONFIG","duration","easing","out","cubic","Pager","Component","enabled","childPanGestureHandlerRefs","addGestureHandlerRef","ref","state","includes","mounted","setState","prevState","createRef","UNDETERMINED","props","navigationState","index","layout","width","routes","length","swipeVelocityImpact","undefined","springVelocityScale","layoutWidth","progress","springConfig","timingConfig","isSwipeGesture","setValue","nextIndex","key","keyboardDismissMode","findIndex","route","jumpToIndex","requestAnimationFrame","dismiss","type","listener","enterListeners","push","indexOf","splice","value","Math","forEach","toValue","frameTime","position","time","finished","clock","isRTL","initialVelocityForSpring","velocityX","velocity","gestureX","nativeEvent","translationX","gestureState","gesturesEnabled","routesLength","toggleEnabled","currentIndexValue","onIndexChange","pendingIndexValue","forceUpdate","lastEnteredIndex","handleEnteredIndexChange","isSwiping","indexAtSwipeEnd","currentIndex","onSwipeStart","onSwipeEnd","interactionHandle","createInteractionHandle","input","currentlyFocusedInput","currentlyFocusedField","blurTextInput","previouslyFocusedTextInput","clearInteractionHandle","focusTextInput","ACTIVE","maybeCancel","offsetX","transitionTo","extrapolatedPosition","translateX","componentDidMount","context","gestureHandlerRef","componentDidUpdate","prevProps","componentWillUnmount","render","swipeEnabled","children","removeClippedSubviews","gestureHandlerProps","getTranslateX","addListener","removeListener","jumpTo","handleGestureEvent","styles","container","transform","providerVal","create","flex","flexDirection"],"mappings":";;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,UADF,EAEEC,SAFF,EAGEC,QAHF,EAIEC,WAJF,EAKEC,kBALF,QAMO,cANP;AAOA,SAASC,iBAAT,EAA4BC,KAA5B,QAAyC,8BAAzC;AACA,OAAOC,QAAP,IACEC,MAAM,IAAIC,SADZ,CAEE;AAFF,EAGEC,UAHF,QAIO,yBAJP;AAKA,OAAOC,OAAP,MAAoB,WAApB;AAaA,MAAMH,MAAM,GAAGE,UAAU,IAAID,SAA7B;AA8BA,MAAM;AACJG,EAAAA,KADI;AAEJC,EAAAA,KAFI;AAGJC,EAAAA,QAHI;AAIJC,EAAAA,GAJI;AAKJC,EAAAA,EALI;AAMJC,EAAAA,GANI;AAOJC,EAAAA,GAPI;AAQJC,EAAAA,KARI;AASJC,EAAAA,IATI;AAUJC,EAAAA,IAVI;AAWJC,EAAAA,YAXI;AAYJC,EAAAA,IAZI;AAaJC,EAAAA,MAbI;AAcJC,EAAAA,EAdI;AAeJC,EAAAA,KAfI;AAgBJC,EAAAA,KAhBI;AAiBJC,EAAAA,WAjBI;AAkBJC,EAAAA,QAlBI;AAmBJC,EAAAA,GAnBI;AAoBJC,EAAAA,GApBI;AAqBJC,EAAAA,QArBI;AAsBJC,EAAAA,GAtBI;AAuBJC,EAAAA,GAvBI;AAwBJC,EAAAA,KAxBI;AAyBJC,EAAAA,GAzBI;AA0BJC,EAAAA,MA1BI;AA2BJC,EAAAA,UA3BI;AA4BJC,EAAAA,SA5BI;AA6BJC,EAAAA,GA7BI;AA8BJC,EAAAA;AA9BI,IA+BFlC,QA/BJ;AAiCA,MAAMmC,YAAY,gBAAG3C,KAAK,CAAC4C,aAAN,CAAoB,EAApB,C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CADG;AAETC,IAAAA,aAAa,EAAE;AAFN;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n  StyleSheet,\n  TextInput,\n  Keyboard,\n  I18nManager,\n  InteractionManager,\n} from 'react-native';\nimport { PanGestureHandler, State } from 'react-native-gesture-handler';\nimport Animated, {\n  Easing as OldEasing,\n  // @ts-ignore\n  EasingNode,\n} from 'react-native-reanimated';\nimport memoize from './memoize';\n\nimport {\n  Layout,\n  NavigationState,\n  Route,\n  Listener,\n  PagerCommonProps,\n  EventEmitterProps,\n} from './types';\n\ntype Binary = 0 | 1;\n\nconst Easing = EasingNode || OldEasing;\n\nexport type Props<T extends Route> = PagerCommonProps & {\n  onIndexChange: (index: number) => void;\n  navigationState: NavigationState<T>;\n  layout: Layout;\n  // Clip unfocused views to improve memory usage\n  // Don't enable this on iOS where this is buggy and views don't re-appear\n  removeClippedSubviews?: boolean;\n  children: (\n    props: EventEmitterProps & {\n      // Animated value which represents the state of current index\n      // It can include fractional digits as it represents the intermediate value\n      position: Animated.Node<number>;\n      // Function to actually render the content of the pager\n      // The parent component takes care of rendering\n      render: (children: React.ReactNode) => React.ReactNode;\n      // Callback to call when switching the tab\n      // The tab switch animation is performed even if the index in state is unchanged\n      jumpTo: (key: string) => void;\n    }\n  ) => React.ReactNode;\n  gestureHandlerProps: React.ComponentProps<typeof PanGestureHandler>;\n};\n\ntype ComponentState = {\n  enabled: boolean;\n  childPanGestureHandlerRefs: React.RefObject<PanGestureHandler>[];\n};\n\nconst {\n  Clock,\n  Value,\n  onChange,\n  and,\n  or,\n  abs,\n  add,\n  block,\n  call,\n  ceil,\n  clockRunning,\n  cond,\n  divide,\n  eq,\n  event,\n  floor,\n  greaterThan,\n  lessThan,\n  max,\n  min,\n  multiply,\n  neq,\n  not,\n  round,\n  set,\n  spring,\n  startClock,\n  stopClock,\n  sub,\n  timing,\n} = Animated;\n\nconst PagerContext = React.createContext({});\n\nconst TRUE = 1;\nconst FALSE = 0;\nconst NOOP = 0;\nconst UNSET = -1;\n\nconst DIRECTION_LEFT = 1;\nconst DIRECTION_RIGHT = -1;\n\nconst SWIPE_DISTANCE_MINIMUM = 20;\n\nconst SWIPE_VELOCITY_IMPACT = 0.2;\n\nconst SPRING_CONFIG = {\n  stiffness: 1000,\n  damping: 500,\n  mass: 3,\n  overshootClamping: true,\n  restDisplacementThreshold: 0.01,\n  restSpeedThreshold: 0.01,\n};\n\nconst SPRING_VELOCITY_SCALE = 1;\n\nconst TIMING_CONFIG = {\n  duration: 200,\n  easing: Easing.out(Easing.cubic),\n};\n\nexport default class Pager<T extends Route> extends React.Component<\n  Props<T>,\n  ComponentState\n> {\n  static defaultProps = {\n    swipeVelocityImpact: SWIPE_VELOCITY_IMPACT,\n    springVelocityScale: SPRING_VELOCITY_SCALE,\n  };\n\n  state = {\n    enabled: true,\n    childPanGestureHandlerRefs: [] as React.RefObject<PanGestureHandler>[],\n  };\n\n  componentDidMount() {\n    this.mounted = true;\n\n    // Register this PanGestureHandler with the parent (if parent exists)\n    // in order to coordinate gestures between handlers.\n    if (this.context && this.context.addGestureHandlerRef) {\n      this.context.addGestureHandlerRef(this.gestureHandlerRef);\n    }\n  }\n\n  componentDidUpdate(prevProps: Props<T>) {\n    const {\n      navigationState,\n      layout,\n      swipeVelocityImpact,\n      springVelocityScale,\n      springConfig,\n      timingConfig,\n    } = this.props;\n    const { index, routes } = navigationState;\n\n    if (\n      // Check for index in state to avoid unintended transition if component updates during swipe\n      (index !== prevProps.navigationState.index &&\n        index !== this.currentIndexValue) ||\n      // Check if the user updated the index correctly after an update\n      (typeof this.pendingIndexValue === 'number' &&\n        index !== this.pendingIndexValue)\n    ) {\n      // Index in user's state is different from the index being tracked\n      this.jumpToIndex(index);\n    }\n\n    // Reset the pending index\n    this.pendingIndexValue = undefined;\n\n    // Update our mappings of animated nodes when props change\n    if (prevProps.navigationState.routes.length !== routes.length) {\n      this.routesLength.setValue(routes.length);\n    }\n\n    if (prevProps.layout.width !== layout.width) {\n      this.progress.setValue(-index * layout.width);\n      this.layoutWidth.setValue(layout.width);\n    }\n\n    if (prevProps.swipeVelocityImpact !== swipeVelocityImpact) {\n      this.swipeVelocityImpact.setValue(\n        swipeVelocityImpact !== undefined\n          ? swipeVelocityImpact\n          : SWIPE_VELOCITY_IMPACT\n      );\n    }\n\n    if (prevProps.springVelocityScale !== springVelocityScale) {\n      this.springVelocityScale.setValue(\n        springVelocityScale !== undefined\n          ? springVelocityScale\n          : SPRING_VELOCITY_SCALE\n      );\n    }\n\n    if (prevProps.springConfig !== springConfig) {\n      this.springConfig.damping.setValue(\n        springConfig.damping !== undefined\n          ? springConfig.damping\n          : SPRING_CONFIG.damping\n      );\n\n      this.springConfig.mass.setValue(\n        springConfig.mass !== undefined ? springConfig.mass : SPRING_CONFIG.mass\n      );\n\n      this.springConfig.stiffness.setValue(\n        springConfig.stiffness !== undefined\n          ? springConfig.stiffness\n          : SPRING_CONFIG.stiffness\n      );\n\n      this.springConfig.restSpeedThreshold.setValue(\n        springConfig.restSpeedThreshold !== undefined\n          ? springConfig.restSpeedThreshold\n          : SPRING_CONFIG.restSpeedThreshold\n      );\n\n      this.springConfig.restDisplacementThreshold.setValue(\n        springConfig.restDisplacementThreshold !== undefined\n          ? springConfig.restDisplacementThreshold\n          : SPRING_CONFIG.restDisplacementThreshold\n      );\n    }\n\n    if (prevProps.timingConfig !== timingConfig) {\n      this.timingConfig.duration.setValue(\n        timingConfig.duration !== undefined\n          ? timingConfig.duration\n          : TIMING_CONFIG.duration\n      );\n    }\n  }\n\n  componentWillUnmount() {\n    this.mounted = false;\n\n    if (this.interactionHandle !== null) {\n      InteractionManager.clearInteractionHandle(this.interactionHandle);\n    }\n  }\n\n  mounted = false;\n\n  static contextType = PagerContext;\n\n  // Mechanism to add child PanGestureHandler refs in the case that this\n  // Pager is a parent to child Pagers. Allows for coordination between handlers\n  private providerVal = {\n    addGestureHandlerRef: (ref: React.RefObject<PanGestureHandler>) => {\n      if (\n        !this.state.childPanGestureHandlerRefs.includes(ref) &&\n        this.mounted\n      ) {\n        this.setState((prevState: ComponentState) => ({\n          childPanGestureHandlerRefs: [\n            ...prevState.childPanGestureHandlerRefs,\n            ref,\n          ],\n        }));\n      }\n    },\n  };\n\n  // PanGestureHandler ref used for coordination with parent handlers\n  private gestureHandlerRef: React.RefObject<\n    PanGestureHandler\n  > = React.createRef();\n\n  // Clock used for tab transition animations\n  private clock = new Clock();\n\n  // Current state of the gesture\n  private velocityX = new Value(0);\n  private gestureX = new Value(0);\n  private gestureState = new Value(State.UNDETERMINED);\n  private offsetX = new Value(0);\n\n  // Tracks current state of gesture handler enabled\n  private gesturesEnabled = new Value(1);\n\n  // Current progress of the page (translateX value)\n  private progress = new Value(\n    // Initial value is based on the index and page width\n    this.props.navigationState.index * this.props.layout.width * DIRECTION_RIGHT\n  );\n\n  // Initial index of the tabs\n  private index = new Value(this.props.navigationState.index);\n\n  // Next index of the tabs, updated for navigation from outside (tab press, state update)\n  private nextIndex: Animated.Value<number> = new Value(UNSET);\n\n  // Scene that was last entered\n  private lastEnteredIndex = new Value(this.props.navigationState.index);\n\n  // Whether the user is currently dragging the screen\n  private isSwiping: Animated.Value<Binary> = new Value(FALSE);\n\n  // Whether the update was due to swipe gesture\n  // This controls whether the transition will use a spring or timing animation\n  // Remember to set it before transition needs to occur\n  private isSwipeGesture: Animated.Value<Binary> = new Value(FALSE);\n\n  // Track the index value when a swipe gesture has ended\n  // This lets us know if a gesture end triggered a tab switch or not\n  private indexAtSwipeEnd: Animated.Value<number> = new Value(\n    this.props.navigationState.index\n  );\n\n  // Mappings to some prop values\n  // We use them in animation calculations, so we need live animated nodes\n  private routesLength = new Value(this.props.navigationState.routes.length);\n  private layoutWidth = new Value(this.props.layout.width);\n\n  // Determines how relevant is a velocity while calculating next position while swiping\n  private swipeVelocityImpact = new Value(\n    this.props.swipeVelocityImpact !== undefined\n      ? this.props.swipeVelocityImpact\n      : SWIPE_VELOCITY_IMPACT\n  );\n\n  private springVelocityScale = new Value(\n    this.props.springVelocityScale !== undefined\n      ? this.props.springVelocityScale\n      : SPRING_VELOCITY_SCALE\n  );\n\n  // The position value represent the position of the pager on a scale of 0 - routes.length-1\n  // It is calculated based on the translate value and layout width\n  // If we don't have the layout yet, we should return the current index\n  private position = cond(\n    this.layoutWidth,\n    divide(multiply(this.progress, -1), this.layoutWidth),\n    this.index\n  );\n\n  // Animation configuration\n  private springConfig = {\n    damping: new Value(\n      this.props.springConfig.damping !== undefined\n        ? this.props.springConfig.damping\n        : SPRING_CONFIG.damping\n    ),\n    mass: new Value(\n      this.props.springConfig.mass !== undefined\n        ? this.props.springConfig.mass\n        : SPRING_CONFIG.mass\n    ),\n    stiffness: new Value(\n      this.props.springConfig.stiffness !== undefined\n        ? this.props.springConfig.stiffness\n        : SPRING_CONFIG.stiffness\n    ),\n    restSpeedThreshold: new Value(\n      this.props.springConfig.restSpeedThreshold !== undefined\n        ? this.props.springConfig.restSpeedThreshold\n        : SPRING_CONFIG.restSpeedThreshold\n    ),\n    restDisplacementThreshold: new Value(\n      this.props.springConfig.restDisplacementThreshold !== undefined\n        ? this.props.springConfig.restDisplacementThreshold\n        : SPRING_CONFIG.restDisplacementThreshold\n    ),\n  };\n\n  private timingConfig = {\n    duration: new Value(\n      this.props.timingConfig.duration !== undefined\n        ? this.props.timingConfig.duration\n        : TIMING_CONFIG.duration\n    ),\n  };\n\n  // The reason for using this value instead of simply passing `this._velocity`\n  // into a spring animation is that we need to reverse it if we're using RTL mode.\n  // Also, it's not possible to pass multiplied value there, because\n  // value passed to STATE of spring (the first argument) has to be Animated.Value\n  // and it's not allowed to pass other nodes there. The result of multiplying is not an\n  // Animated.Value. So this value is being updated on each start of spring animation.\n  private initialVelocityForSpring = new Value(0);\n\n  // The current index change caused by the pager's animation\n  // The pager is used as a controlled component\n  // We need to keep track of the index to determine when to trigger animation\n  // The state will change at various points, we should only respond when we are out of sync\n  // This will ensure smoother animation and avoid weird glitches\n  private currentIndexValue = this.props.navigationState.index;\n\n  // The pending index value as result of state update caused by swipe gesture\n  // We need to set it when state changes from inside this component\n  // It also needs to be reset right after componentDidUpdate fires\n  private pendingIndexValue: number | undefined = undefined;\n\n  // Numeric id of the previously focused text input\n  // When a gesture didn't change the tab, we can restore the focused input with this\n  private previouslyFocusedTextInput: number | null = null;\n\n  // Listeners for the entered screen\n  private enterListeners: Listener[] = [];\n\n  // InteractionHandle to handle tasks around animations\n  private interactionHandle: number | null = null;\n\n  private jumpToIndex = (index: number) => {\n    // If the index changed, we need to trigger a tab switch\n    this.isSwipeGesture.setValue(FALSE);\n    this.nextIndex.setValue(index);\n  };\n\n  private jumpTo = (key: string) => {\n    const { navigationState, keyboardDismissMode } = this.props;\n\n    const index = navigationState.routes.findIndex(\n      (route) => route.key === key\n    );\n\n    // A tab switch might occur when we're in the middle of a transition\n    // In that case, the index might be same as before\n    // So we conditionally make the pager to update the position\n    this.jumpToIndex(index);\n    if (navigationState.index !== index) {\n      requestAnimationFrame(() => {\n        // When the index changes, the focused input will no longer be in current tab\n        // So we should dismiss the keyboard\n        if (keyboardDismissMode === 'auto') {\n          Keyboard.dismiss();\n        }\n      });\n    }\n  };\n\n  private addListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter':\n        this.enterListeners.push(listener);\n        break;\n    }\n  };\n\n  private removeListener = (type: 'enter', listener: Listener) => {\n    switch (type) {\n      case 'enter': {\n        const index = this.enterListeners.indexOf(listener);\n\n        if (index > -1) {\n          this.enterListeners.splice(index, 1);\n        }\n\n        break;\n      }\n    }\n  };\n\n  private handleEnteredIndexChange = ([value]: readonly number[]) => {\n    const index = Math.max(\n      0,\n      Math.min(value, this.props.navigationState.routes.length - 1)\n    );\n\n    this.enterListeners.forEach((listener) => listener(index));\n  };\n\n  private transitionTo = (index: Animated.Node<number>) => {\n    const toValue = new Value(0);\n    const frameTime = new Value(0);\n\n    const state = {\n      position: this.progress,\n      time: new Value(0),\n      finished: new Value(FALSE),\n    };\n\n    return block([\n      cond(clockRunning(this.clock), NOOP, [\n        // Animation wasn't running before\n        // Set the initial values and start the clock\n        set(toValue, multiply(index, this.layoutWidth, DIRECTION_RIGHT)),\n        set(frameTime, 0),\n        set(state.time, 0),\n        set(state.finished, FALSE),\n        set(this.index, index),\n      ]),\n      cond(\n        this.isSwipeGesture,\n        // Animate the values with a spring for swipe\n        [\n          cond(\n            not(clockRunning(this.clock)),\n            I18nManager.isRTL\n              ? set(\n                  this.initialVelocityForSpring,\n                  multiply(-1, this.velocityX, this.springVelocityScale)\n                )\n              : set(\n                  this.initialVelocityForSpring,\n                  multiply(this.velocityX, this.springVelocityScale)\n                )\n          ),\n          spring(\n            this.clock,\n            { ...state, velocity: this.initialVelocityForSpring },\n            { ...SPRING_CONFIG, ...this.springConfig, toValue }\n          ),\n        ],\n        // Otherwise use a timing animation for faster switching\n        timing(\n          this.clock,\n          { ...state, frameTime },\n          { ...TIMING_CONFIG, ...this.timingConfig, toValue }\n        )\n      ),\n      cond(not(clockRunning(this.clock)), startClock(this.clock)),\n      cond(state.finished, [\n        // Reset values\n        set(this.isSwipeGesture, FALSE),\n        set(this.gestureX, 0),\n        set(this.velocityX, 0),\n        // When the animation finishes, stop the clock\n        stopClock(this.clock),\n      ]),\n    ]);\n  };\n\n  private handleGestureEvent = event([\n    {\n      nativeEvent: {\n        translationX: this.gestureX,\n        velocityX: this.velocityX,\n        state: this.gestureState,\n      },\n    },\n  ]);\n\n  private extrapolatedPosition = add(\n    this.gestureX,\n    multiply(this.velocityX, this.swipeVelocityImpact)\n  );\n\n  private toggleEnabled = () => {\n    if (this.state.enabled && this.mounted)\n      this.setState({ enabled: false }, () => {\n        this.setState({ enabled: true });\n      });\n  };\n\n  // Cancel gesture if swiping back from the initial tab or forward from the last tab.\n  // Enables parent Pager to pick up the gesture if one exists.\n  private maybeCancel = block([\n    cond(\n      and(\n        this.gesturesEnabled,\n        or(\n          and(\n            eq(this.index, sub(this.routesLength, 1)),\n            lessThan(this.gestureX, 0)\n          ),\n          and(eq(this.index, 0), greaterThan(this.gestureX, 0))\n        )\n      ),\n      set(this.gesturesEnabled, 0)\n    ),\n  ]);\n\n  private translateX = block([\n    onChange(\n      this.gesturesEnabled,\n      cond(\n        not(this.gesturesEnabled),\n        call([this.gesturesEnabled], this.toggleEnabled)\n      )\n    ),\n    onChange(\n      this.index,\n      call([this.index], ([value]) => {\n        this.currentIndexValue = value;\n        // Without this check, the pager can go to an infinite update <-> animate loop for sync updates\n        if (value !== this.props.navigationState.index) {\n          // If the index changed, and previous animation has finished, update state\n          this.props.onIndexChange(value);\n\n          this.pendingIndexValue = value;\n\n          // Force componentDidUpdate to fire, whether user does a setState or not\n          // This allows us to detect when the user drops the update and revert back\n          // It's necessary to make sure that the state stays in sync\n          if (this.mounted) {\n            this.forceUpdate();\n          }\n        }\n      })\n    ),\n    onChange(\n      this.position,\n      // Listen to updates in the position to detect when we enter a screen\n      // This is useful for things such as lazy loading when index change will fire too late\n      cond(\n        I18nManager.isRTL\n          ? lessThan(this.gestureX, 0)\n          : greaterThan(this.gestureX, 0),\n        // Based on the direction of the gesture, determine if we're entering the previous or next screen\n        cond(neq(floor(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, floor(this.position)),\n          call([floor(this.position)], this.handleEnteredIndexChange),\n        ]),\n        cond(neq(ceil(this.position), this.lastEnteredIndex), [\n          set(this.lastEnteredIndex, ceil(this.position)),\n          call([ceil(this.position)], this.handleEnteredIndexChange),\n        ])\n      )\n    ),\n    onChange(\n      this.isSwiping,\n      // Listen to updates for this value only when it changes\n      // Without `onChange`, this will fire even if the value didn't change\n      // We don't want to call the listeners if the value didn't change\n      [\n        cond(not(this.isSwiping), set(this.gesturesEnabled, 1)),\n        call(\n          [this.isSwiping, this.indexAtSwipeEnd, this.index],\n          ([isSwiping, indexAtSwipeEnd, currentIndex]: readonly number[]) => {\n            const {\n              keyboardDismissMode,\n              onSwipeStart,\n              onSwipeEnd,\n            } = this.props;\n\n            if (isSwiping === TRUE) {\n              onSwipeStart?.();\n              this.interactionHandle = InteractionManager.createInteractionHandle();\n\n              if (keyboardDismissMode === 'auto') {\n                // @ts-ignore: the method is only available in newer React Native, but types aren't up-to-date\n                const input = TextInput.State.currentlyFocusedInput\n                  ? // @ts-ignore\n                    TextInput.State.currentlyFocusedInput()\n                  : TextInput.State.currentlyFocusedField();\n\n                // When a gesture begins, blur the currently focused input\n                TextInput.State.blurTextInput(input);\n\n                // Store the id of this input so we can refocus it if gesture was cancelled\n                this.previouslyFocusedTextInput = input;\n              } else if (keyboardDismissMode === 'on-drag') {\n                Keyboard.dismiss();\n              }\n            } else {\n              onSwipeEnd?.();\n\n              if (this.interactionHandle !== null) {\n                InteractionManager.clearInteractionHandle(\n                  this.interactionHandle\n                );\n              }\n\n              if (keyboardDismissMode === 'auto') {\n                if (indexAtSwipeEnd === currentIndex) {\n                  // The index didn't change, we should restore the focus of text input\n                  const input = this.previouslyFocusedTextInput;\n\n                  if (input) {\n                    TextInput.State.focusTextInput(input);\n                  }\n                }\n\n                this.previouslyFocusedTextInput = null;\n              }\n            }\n          }\n        ),\n      ]\n    ),\n    onChange(\n      this.nextIndex,\n      cond(neq(this.nextIndex, UNSET), [\n        // Stop any running animations\n        cond(clockRunning(this.clock), stopClock(this.clock)),\n        set(this.gestureX, 0),\n        // Update the index to trigger the transition\n        set(this.index, this.nextIndex),\n        set(this.nextIndex, UNSET),\n      ])\n    ),\n    cond(\n      eq(this.gestureState, State.ACTIVE),\n      [\n        this.maybeCancel,\n        cond(this.isSwiping, NOOP, [\n          // We weren't dragging before, set it to true\n          set(this.isSwiping, TRUE),\n          set(this.isSwipeGesture, TRUE),\n          // Also update the drag offset to the last progress\n          set(this.offsetX, this.progress),\n        ]),\n        // Update progress with previous offset + gesture distance\n        set(\n          this.progress,\n          I18nManager.isRTL\n            ? sub(this.offsetX, this.gestureX)\n            : add(this.offsetX, this.gestureX)\n        ),\n        // Stop animations while we're dragging\n        stopClock(this.clock),\n      ],\n      [\n        set(this.isSwiping, FALSE),\n        set(this.indexAtSwipeEnd, this.index),\n        this.transitionTo(\n          cond(\n            and(\n              // We should consider velocity and gesture distance only when a swipe ends\n              // The gestureX value will be non-zero when swipe has happened\n              // We check against a minimum distance instead of 0 because `activeOffsetX` doesn't seem to be respected on Android\n              // For other factors such as state update, the velocity and gesture distance don't matter\n              greaterThan(abs(this.gestureX), SWIPE_DISTANCE_MINIMUM),\n              greaterThan(\n                abs(this.extrapolatedPosition),\n                divide(this.layoutWidth, 2)\n              )\n            ),\n            // For swipe gesture, to calculate the index, determine direction and add to index\n            // When the user swipes towards the left, we transition to the next tab\n            // When the user swipes towards the right, we transition to the previous tab\n            round(\n              min(\n                max(\n                  0,\n                  sub(\n                    this.index,\n                    cond(\n                      greaterThan(this.extrapolatedPosition, 0),\n                      I18nManager.isRTL ? DIRECTION_RIGHT : DIRECTION_LEFT,\n                      I18nManager.isRTL ? DIRECTION_LEFT : DIRECTION_RIGHT\n                    )\n                  )\n                ),\n                sub(this.routesLength, 1)\n              )\n            ),\n            // Index didn't change/changed due to state update\n            this.index\n          )\n        ),\n      ]\n    ),\n    this.progress,\n  ]);\n\n  private getTranslateX = memoize(\n    (\n      layoutWidth: Animated.Node<number>,\n      routesLength: Animated.Node<number>,\n      translateX: Animated.Node<number>\n    ) =>\n      multiply(\n        // Make sure that the translation doesn't exceed the bounds to prevent overscrolling\n        min(\n          max(\n            multiply(layoutWidth, sub(routesLength, 1), DIRECTION_RIGHT),\n            translateX\n          ),\n          0\n        ),\n        I18nManager.isRTL ? -1 : 1\n      )\n  );\n\n  render() {\n    const {\n      layout,\n      navigationState,\n      swipeEnabled,\n      children,\n      removeClippedSubviews,\n      gestureHandlerProps,\n    } = this.props;\n\n    const translateX = this.getTranslateX(\n      this.layoutWidth,\n      this.routesLength,\n      this.translateX\n    );\n\n    return children({\n      position: this.position,\n      addListener: this.addListener,\n      removeListener: this.removeListener,\n      jumpTo: this.jumpTo,\n      render: (children) => (\n        <PanGestureHandler\n          ref={this.gestureHandlerRef}\n          simultaneousHandlers={this.state.childPanGestureHandlerRefs}\n          waitFor={this.state.childPanGestureHandlerRefs}\n          enabled={layout.width !== 0 && swipeEnabled && this.state.enabled}\n          onGestureEvent={this.handleGestureEvent}\n          onHandlerStateChange={this.handleGestureEvent}\n          activeOffsetX={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          failOffsetY={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}\n          {...gestureHandlerProps}\n        >\n          <Animated.View\n            removeClippedSubviews={removeClippedSubviews}\n            style={[\n              styles.container,\n              layout.width\n                ? {\n                    width: layout.width * navigationState.routes.length,\n                    transform: [{ translateX }] as any,\n                  }\n                : null,\n            ]}\n          >\n            <PagerContext.Provider value={this.providerVal}>\n              {children}\n            </PagerContext.Provider>\n          </Animated.View>\n        </PanGestureHandler>\n      ),\n    });\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    flexDirection: 'row',\n  },\n});\n"]}
\ No newline at end of file
diff --git a/node_modules/react-native-tab-view/src/Pager.tsx b/node_modules/react-native-tab-view/src/Pager.tsx
index 3441d69..f73d1d8 100644
--- a/node_modules/react-native-tab-view/src/Pager.tsx
+++ b/node_modules/react-native-tab-view/src/Pager.tsx
@@ -410,7 +410,7 @@ export default class Pager<T extends Route> extends React.Component<
   };
 
   private jumpTo = (key: string) => {
-    const { navigationState, keyboardDismissMode, onIndexChange } = this.props;
+    const { navigationState, keyboardDismissMode } = this.props;
 
     const index = navigationState.routes.findIndex(
       (route) => route.key === key
@@ -419,16 +419,15 @@ export default class Pager<T extends Route> extends React.Component<
     // A tab switch might occur when we're in the middle of a transition
     // In that case, the index might be same as before
     // So we conditionally make the pager to update the position
-    if (navigationState.index === index) {
-      this.jumpToIndex(index);
-    } else {
-      onIndexChange(index);
-
-      // When the index changes, the focused input will no longer be in current tab
-      // So we should dismiss the keyboard
-      if (keyboardDismissMode === 'auto') {
-        Keyboard.dismiss();
-      }
+    this.jumpToIndex(index);
+    if (navigationState.index !== index) {
+      requestAnimationFrame(() => {
+        // When the index changes, the focused input will no longer be in current tab
+        // So we should dismiss the keyboard
+        if (keyboardDismissMode === 'auto') {
+          Keyboard.dismiss();
+        }
+      });
     }
   };

darron1217 avatar Feb 28 '21 02:02 darron1217

same I updated [email protected] but it's still slow

phuocantd avatar Sep 15 '21 03:09 phuocantd

+1

lucasftcruz avatar Sep 30 '21 20:09 lucasftcruz

+1

seanbaergen avatar Oct 29 '21 20:10 seanbaergen

same here, this was solved ?

brunofariasd avatar Dec 07 '21 19:12 brunofariasd

same problem on ios

h1nson avatar Dec 20 '21 10:12 h1nson

+1

AlaaEdAouimeur avatar Feb 16 '22 15:02 AlaaEdAouimeur

+1

MedRaid avatar Apr 26 '22 13:04 MedRaid

+1

hiepnsx avatar May 24 '22 01:05 hiepnsx

it's seem that it's not the problem of this library. i think you guys should use pureComponent to optimize your code. i have fixed this issue, the cause is that each tab child component rendered every time on tab changes.

h1nson avatar May 24 '22 03:05 h1nson