react-native-zoom-toolkit
Version:
Most complete set of pinch to zoom utilites for React Native
13 lines (10 loc) • 351 B
text/typescript
import { useSharedValue, type SharedValue } from 'react-native-reanimated';
import type { SizeVector } from '../types';
export const useSizeVector = (
x: number,
y: number
): SizeVector<SharedValue<number>> => {
const first = useSharedValue<number>(x);
const second = useSharedValue<number>(y);
return { width: first, height: second };
};