react-native-reanimated-carousel
Version:
Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.
15 lines (11 loc) • 391 B
text/typescript
import { useEffect } from "react";
import type { PanGesture } from "react-native-gesture-handler";
export interface GestureConfig {
enabled?: boolean;
}
export const useUpdateGestureConfig = (gesture: PanGesture, config: GestureConfig) => {
const { enabled } = config;
useEffect(() => {
if (typeof enabled !== "undefined") gesture.enabled(enabled);
}, [enabled, gesture]);
};