Menu

Why Reanimated exists: block the JS thread and watch which animation stops
📰

Why Reanimated exists: block the JS thread and watch which animation stops

DEV Community: reactnative·Praveen Singh·6 days ago
#dlMMRs9B
#devtoreactnative#devto#dev#thread#javascript
Long article (1682 words) — no AI summary yet.
Reading 0:00
15s threshold

At a glance

Problem: Animations that stutter or freeze whenever the app is busy loading, parsing or rendering

Fix: Run them on the UI thread: Reanimated, or Animated with useNativeDriver for transforms and opacity

Result: 60 (frames lost for every second the JS thread is blocked at 60 Hz (120 on a 120 Hz screen))

Short answer: A React Native app runs your JavaScript on one thread and draws the screen on another. An animation that JavaScript moves frame by frame stops whenever that thread is busy. Reanimated, and Animated with useNativeDriver: true , hand the animation to the UI thread, so it keeps running while JavaScript is stuck. They don't make the JS thread any faster: taps, state updates and callbacks still wait for it.

Try it first

Both dots below run the same animation, with the same easing and timing. The top one is moved by JavaScript on every

frame. The bottom one isn't.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.