From dc7bd2ce5f42c86cb932173960cf402d83262f1d Mon Sep 17 00:00:00 2001 From: Bohdan Artiukhov <69891500+bohdanprog@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:38:48 +0200 Subject: [PATCH] fix: problem with reanimated example in web platoform (#2390) # Summary Fixed the problem with a reanimated example. In the web platform, it can't be a negative value. --- apps/examples/src/examples/Reanimated.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/examples/src/examples/Reanimated.tsx b/apps/examples/src/examples/Reanimated.tsx index b7603e15..43c8567f 100644 --- a/apps/examples/src/examples/Reanimated.tsx +++ b/apps/examples/src/examples/Reanimated.tsx @@ -6,6 +6,7 @@ import Reanimated, { withRepeat, withSpring, withTiming, + withClamp, } from 'react-native-reanimated'; import {Svg, Rect} from 'react-native-svg'; @@ -17,7 +18,7 @@ function ReanimatedRectExample() { const position = useSharedValue(0); useEffect(() => { - height.value = withRepeat(withSpring(100), -1, true); + height.value = withClamp({min: 0}, withRepeat(withSpring(100), -1, true)); position.value = withRepeat(withTiming(300, {duration: 5000}), -1); }); const animatedProps = useAnimatedProps(() => ({