Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/vitest-react-native. Run React Native unit and component tests with Vitest
Something went wrong. Try again.
537 B · 21 lines
TSX
at main
12345678910111213141516171819202122import { Pressable, Text } from 'react-native';import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
export function ExpandingCard() { const width = useSharedValue(0);
const style = useAnimatedStyle(() => ({ width: width.value }));
return ( <> <Animated.View testID="card" style={style} /> <Pressable onPress={() => { width.value = withTiming(200, { duration: 300 }); }} > <Text>Expand</Text> </Pressable> </> );}