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.
This commit is contained in:
Bohdan Artiukhov
2024-08-01 15:38:48 +02:00
committed by GitHub
parent b3a72e871f
commit dc7bd2ce5f
+2 -1
View File
@@ -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(() => ({