1 | import * as React from 'react';
|
2 | import { Animated } from 'react-native';
|
3 |
|
4 | export default function useAnimatedValue(initialValue: number) {
|
5 | const lazyRef = React.useRef<Animated.Value>();
|
6 |
|
7 | if (lazyRef.current === undefined) {
|
8 | lazyRef.current = new Animated.Value(initialValue);
|
9 | }
|
10 |
|
11 | return lazyRef.current as Animated.Value;
|
12 | }
|