How to use the react-native-redash.gestureEvent function in react-native-redash

To help you get started, we’ve selected a few react-native-redash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wcandillon / can-it-be-done-in-react-native / season2 / safari-tabs / components / Tabs.tsx View on Github external
const { onGestureEvent, translateY } = useMemo(() => {
    const translationY = new Value(0);
    const velocityY = new Value(0);
    const state = new Value(State.UNDETERMINED);
    const translateY1 = limit(
      decay(translationY, state, velocityY),
      state,
      -tabsProps.length * 100,
      0
    );
    return {
      translateY: bInterpolate(transitionVal, 0, translateY1),
      onGestureEvent: gestureEvent({
        translationY,
        velocityY,
        state
      })
    };
  }, [tabsProps.length, transitionVal]);
  return (
github wcandillon / can-it-be-done-in-react-native / season2 / safari-tabs / components / Content.tsx View on Github external
() => ({
      onGestureEvent: gestureEvent({
        translationX,
        velocityX,
        state
      }),
      translateX: spring(
        translationX,
        state,
        snapPoint(translationX, velocityX, snapPoints)
      )
    }),
    [state, translationX, velocityX]