@devvie/bottom-sheet
Version:
The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀
15 lines (14 loc) • 570 B
JavaScript
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 = function () {
let initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
const animatedValue = useRef(new Animated.Value(initialValue)).current;
return animatedValue;
};
export default useAnimatedValue;
//# sourceMappingURL=useAnimatedValue.js.map