Overview
TheHelloWave component is a simple animated emoji component that displays a waving hand (👋) with a rotating animation. It’s used as a friendly greeting element in the home screen to add personality and motion to the UI.
Import
Props
This component does not accept any props.Usage
In Home Screen
Fromsrc/app/(tabs)/index.tsx:
Animation Behavior
The component uses React Native Reanimated to create a waving motion:- Animation: Rotates between 0° and 25°
- Duration: 300ms per iteration
- Iterations: 4 complete waves
- Timing: Animates to 25° rotation at 50% progress, then back to 0°
Implementation Details
Styling
The component has built-in styling:- Font size: 28 pixels
- Line height: 32 pixels
- Margin top: -6 pixels (for vertical alignment)
Performance
The animation uses React Native Reanimated, which runs animations on the native thread for smooth 60fps performance without blocking the JavaScript thread. This ensures the waving animation is fluid even on lower-end devices.Customization
While the component doesn’t accept props, you can customize it by:- Changing the emoji: Replace
👋with any other emoji - Adjusting animation speed: Modify
animationDuration - Changing rotation angle: Adjust the
rotatevalue in the animation keyframes - Modifying iteration count: Change
animationIterationCountfor more or fewer waves
Related
- React Native Reanimated - Animation library documentation
- ThemedText - Text component used alongside HelloWave