diff --git a/package.json b/package.json index ebf3b0a..1c050b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-reanimated-zoom", - "version": "0.1.2", + "version": "0.1.4", "description": "Component to add zoom in react native views.", "main": "lib/commonjs/index", "module": "lib/module/index", @@ -64,10 +64,10 @@ "react": "16.13.1", "react-native": "0.63.4", "react-native-builder-bob": "^0.18.2", - "release-it": "^14.2.2", - "typescript": "^4.1.3", "react-native-gesture-handler": "~2.1.0", - "react-native-reanimated": "~2.3.1" + "react-native-reanimated": "~2.3.1", + "release-it": "^14.2.2", + "typescript": "^4.1.3" }, "peerDependencies": { "react": "*", diff --git a/src/index.tsx b/src/index.tsx index a7ae209..d912698 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,7 +7,6 @@ import Animated, { withTiming, cancelAnimation, runOnJS, - withSpring, } from 'react-native-reanimated'; import { Gesture, GestureDetector } from 'react-native-gesture-handler'; @@ -78,17 +77,17 @@ export function Zoom(props: Props) { prevTranslationY.value + e.translationY - panTranslateY.value; if (nextTranslateX > maxTranslateX) { - translationX.value = withSpring(maxTranslateX); + translationX.value = maxTranslateX; } else if (nextTranslateX < minTranslateX) { - translationX.value = withSpring(minTranslateX); + translationX.value = minTranslateX; } else { translationX.value = nextTranslateX; } if (nextTranslateY > maxTranslateY) { - translationY.value = withSpring(maxTranslateX); + translationY.value = maxTranslateX; } else if (nextTranslateY < minTranslateY) { - translationY.value = withSpring(minTranslateY); + translationY.value = minTranslateY; } else { translationY.value = nextTranslateY; }