diff --git a/app/src/examples/WithClampExample.tsx b/app/src/examples/WithClampExample.tsx deleted file mode 100644 index e5735771f49..00000000000 --- a/app/src/examples/WithClampExample.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import Animated, { - useSharedValue, - useAnimatedStyle, - withSpring, - withClamp, -} from 'react-native-reanimated'; -import { View, Text, Button, StyleSheet, ViewStyle } from 'react-native'; -import React, { useState } from 'react'; - -const VIOLET = '#b58df1'; -const BORDER_WIDTH = 4; -const FRAME_WIDTH = 300; - -function renderFramedExample(testedStyle: ViewStyle, description: string) { - return ( - <> - {description} - - - - - - - ); -} - -export default function AnimatedStyleUpdateExample() { - const randomWidth = useSharedValue(100); - const [toggle, setToggle] = useState(false); - - const config = { - duration: 25000, - dampingRatio: 0.075, - clamp: [120, 220], - }; - - const clampedStyle = useAnimatedStyle(() => { - return { - width: withClamp( - { min: 120, max: 220 }, - withSpring(randomWidth.value, config) - ), - }; - }); - const style = useAnimatedStyle(() => { - return { - width: withSpring(randomWidth.value, config), - }; - }); - - return ( - - {renderFramedExample(clampedStyle, 'Clamp example')} - - {renderFramedExample(style, 'Default')} -