UNPKG

react-native-zoom-toolkit

Version:

Smoothly zoom any image, video or component you want!

13 lines (10 loc) 357 B
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 ?? x); return { width: first, height: second }; };