Animations and gestures · senior
Reanimated 4: CSS animations, transitions and layout animations
Reanimated 4 adds web-style CSS animations (animationName with keyframes) and CSS transitions in the style prop for state-driven effects, keeps worklets for gesture and scroll work, and offers entering, exiting and layout animations for items that appear, leave or move.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- CSS animations: on an Animated.View style, set animationName to a keyframes object (from/to or "50%"), plus animationDuration ("300ms"), animationIterationCount and animationTimingFunction.
- CSS transitions: set transitionProperty and transitionDuration; when that style value changes (for example from React state), Reanimated animates the change.
- Use CSS animations or transitions for declarative, state-driven UI (a toggle, a skeleton pulse). Use worklets for gesture- and scroll-driven animation.
- Layout animations: entering, exiting and layout props (FadeIn, SlideOutLeft, LinearTransition). Reanimated 4.7 made the new layout-animation engine the default.
- Removed in v4: useWorkletCallback (use useCallback with "worklet"), combineTransition (use EntryExitTransition), react-native-v8 support.
- Recycled lists (FlashList) can misfire entering/exiting animations; animate keyed wrappers or use the list's own support.
The red pen
Common traps: mistake → fix
Mistake: "Reanimated 4 is a rewrite, so everything must change"
Fix: most worklet code keeps working; the renames are small.
Mistake: "CSS animations replace worklets"
Fix: gestures and scroll-linked effects still need worklets.
Mistake: "Spring timings did not change"
Fix: v4 springs run about 1.5× the given duration and use new defaults.
Easy to hard
Questions interviewers ask, easy to hard
- What changed in Reanimated 4?
- When would you use a CSS transition instead of useAnimatedStyle?
- When an item is removed from a list, the rest should slide up smoothly. Options?
- Why is Reanimated 4 New-Architecture-only?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.