mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-24 19:48:46 +00:00
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:
@@ -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(() => ({
|
||||
|
||||
Reference in New Issue
Block a user