MCPcopy Create free account
hub / github.com/callstack/react-native-paper / useAnimatedValueArray

Function useAnimatedValueArray

src/utils/useAnimatedValueArray.tsx:4–13  ·  view source on GitHub ↗
(initialValues: number[])

Source from the content-addressed store, hash-verified

2import { Animated } from 'react-native';
3
4export default function useAnimatedValueArray(initialValues: number[]) {
5 const refs = React.useRef<Animated.Value[]>([]);
6
7 refs.current.length = initialValues.length;
8 initialValues.forEach((initialValue, i) => {
9 refs.current[i] = refs.current[i] ?? new Animated.Value(initialValue);
10 });
11
12 return refs.current;
13}

Callers 2

BottomNavigationBarFunction · 0.85
BottomNavigationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…