this repo has no description
1import { useEffect } from 'react';
2import { StyleSheet } from 'react-native';
3import Animated, {
4 useAnimatedStyle,
5 useSharedValue,
6 withRepeat,
7 withSequence,
8 withTiming,
9} from 'react-native-reanimated';
10
11import { ThemedText } from '@/components/ThemedText';
12
13export function HelloWave() {
14 const rotationAnimation = useSharedValue(0);
15
16 useEffect(() => {
17 rotationAnimation.value = withRepeat(
18 withSequence(withTiming(25, { duration: 150 }), withTiming(0, { duration: 150 })),
19 4 // Run the animation 4 times
20 );
21 }, [rotationAnimation]);
22
23 const animatedStyle = useAnimatedStyle(() => ({
24 transform: [{ rotate: `${rotationAnimation.value}deg` }],
25 }));
26
27 return (
28 <Animated.View style={animatedStyle}>
29 <ThemedText style={styles.text}>👋</ThemedText>
30 </Animated.View>
31 );
32}
33
34const styles = StyleSheet.create({
35 text: {
36 fontSize: 28,
37 lineHeight: 32,
38 marginTop: -6,
39 },
40});