Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 (
() => ({
onGestureEvent: gestureEvent({
translationX,
velocityX,
state
}),
translateX: spring(
translationX,
state,
snapPoint(translationX, velocityX, snapPoints)
)
}),
[state, translationX, velocityX]