Journal
Oct 11, 2026·2 min read· Mobile

Animations that do not wait for JavaScript

A React Native app has a JavaScript thread and a UI thread. Your components, state and network handlers run on the first. Pixels are drawn on the second. An animation driven from JavaScript has to cross between them every frame, and it stutters the moment JavaScript is busy parsing a response or rendering a list.

Run the animation where the pixels are

Reanimated lets you write small functions, called worklets, that run on the UI thread. A shared value holds the number being animated; an animated style reads it. Once started, the animation does not need JavaScript at all. Combined with Gesture Handler, a drag follows the finger even while the JavaScript thread is blocked.

Stick to transform and opacity

These are cheap everywhere: the system moves or fades a layer it already has. Animating width, height or margins forces layout on every frame. If something needs to grow, scale it. If it needs to move, translate it.

Start from the gesture, not from state

A bottom sheet that sets React state on every drag event will lag. Keep the position in a shared value while the finger is down, and only update React state when the gesture ends and you know where it settled.

Respect "reduce motion"

Both platforms expose the setting. Honour it: replace movement with a fade, or with nothing.

A test I use

Throttle the JavaScript thread on purpose, with a long loop behind a debug button, and try the animation. If it still moves smoothly, it is in the right place.