UNPKG

@devvie/bottom-sheet

Version:

The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀

15 lines (12 loc) • 469 B
import { useRef } from 'react'; import { Animated } from 'react-native'; /** * Convenience hook for abstracting/storing Animated values. * Pass your initial number value, get an animated value back. * @param {number} initialValue Initial animated value */ const useAnimatedValue = (initialValue: number = 0): Animated.Value => { const animatedValue = useRef(new Animated.Value(initialValue)).current; return animatedValue; }; export default useAnimatedValue;