StaffCoder
React Native
React NativeReact Native 0.81
12 modules · 47 challengesSign up
Modules12 modules · 47 challenges
The motion layer of a React Native app. A single Animated.Value drives a bar width and a colour interpolation from amber to green; Animated.timing, Animated.spring, Animated.stagger, Animated.sequence and Animated.parallel compose the transitions between states. A reducedMotion flag skips the animation and sets the final value immediately so accessibility preferences are honoured. Gestures come from PanResponder — a drag moves a marker within clamped bounds and converts the offset into a live readout; release snaps to the nearest legal target with Animated.spring; a double press returns to a recommended value. Every running composite is stoppable so a skip control jumps straight to the final state; composites are torn down on unmount so no post-unmount state update fires.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Savings Goal Progress Bar

Sign up to unlock
—No data yetmedium
About this challenge

A savings goal progress indicator in a personal finance app. A single Animated.Value drives the bar width and a colour ramp from amber to green as the goal is approached, both derived from the same interpolated value. Logged contributions animate to the new position with Animated.timing; withdrawals animate back down. A reducedMotion prop skips the animation and sets the value immediately with no intermediate frames. The colour interpolation is not driven natively so the ramp keeps working under all render modes.

Solved in a browser IDE and graded by tests. Sign up to solve

Fare Comparison Reveal

Sign up to unlock
—No data yetmedium
About this challenge

The results reveal on a fare comparison screen. Fare options reveal with Animated.stagger over per-row values; the best-value badge runs an Animated.sequence (scale up, then settle); dearer rows fade together with Animated.parallel. A skip control stops every running animation and jumps every value to its final state. Animations are stopped on unmount so no post-unmount state update fires.

Solved in a browser IDE and graded by tests. Sign up to solve

Cinema Seat Picker

Sign up to unlock
—No data yetmedium
About this challenge

The seat picker a customer drags across the auditorium plan to choose where to sit. A PanResponder moves a marker within bounds, clamping at the edges and converting the offset into section / row / seat number shown live. Release snaps to the nearest available seat with Animated.spring — never onto a taken seat; a double press returns to the recommended seat. The responder is granted only on the plan and releases cleanly on gesture end.

Solved in a browser IDE and graded by tests. Sign up to solve

Trip Itinerary Reorder

STAR
Solving it completes the module
—No data yetmedium
About this challenge

The day planner where a traveller long-presses a stop and drags it to a new position, with the reordered plan living in shared app state. A long press lifts a stop card and PanResponder translates it with the finger while the stops it passes animate aside with Animated.timing to open a gap. The plan is held in a context backed by a reducer; release dispatches a move with the source and target index, and a rejected move (a stop with a fixed booking time cannot cross another fixed stop) springs the card back with no state change. Neighbours translate only while a card is lifted and reset on release; consumers of unaffected days do not re-render; an undo control restores the previous order. Star problem — accumulates the Animated interpolation + reduced-motion of 10314, the Animated composition + cleanup of 10315, and the PanResponder + spring-snap discipline of 10316, and lands them on a shared reducer-backed plan with undo.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.