GT2/Ejectable/node_modules/react-native-reanimated/lib/reanimated1/useValue.js
2021-08-16 00:14:59 +00:00

10 lines
270 B
JavaScript

import React from 'react';
import AnimatedValue from './core/AnimatedValue';
export default function useValue(initialValue) {
const ref = React.useRef(null);
if (ref.current === null) {
ref.current = new AnimatedValue(initialValue);
}
return ref.current;
}