React Native Game Loop Engine Hook
setState 60 times a second melts the bridge. The game loop runs outside React's render cycle and only touches it when it must.
TL;DR
A game loop, update state and render every frame at 60fps, fights React Native's event-driven model: running it with setInterval and per-frame setState melts the bridge and drops frames. The right foundation runs frame-synced off the JS thread, a Reanimated worklet (5,266,534 weekly downloads) for most games or a Skia frame callback for drawing-heavy ones, wrapped in a useGameLoop(callback) hook that fires each frame with delta time. Delta time is the critical detail: scale movement by elapsed time so the game runs at the same speed on 60Hz, 120Hz, and frame-dropping devices, or it is subtly broken. Add start/stop/pause and stop-on-blur. Honest scope: great for 2D and casual games, not a replacement for a real 3D engine. A free VP0 design supplies the canvas and HUD screens.
What is a game loop, and why does React’s model fight it?
A game loop is the heartbeat of any real-time game: every frame, update the game state (move things, check collisions, advance physics) and render, ideally 60 times a second. The problem is that React Native is built for event-driven UI, not a continuous tick, so naively running a game loop by calling setState 60 times a second is the architecture that melts the bridge and drops frames. A “game loop engine hook” is the pattern that gives you a steady per-frame tick in React Native without fighting React, and getting that foundation right is what makes a smooth game possible at all.
The honest framing first: React’s render-on-state-change model is the wrong tool for the per-frame update, so the game loop runs outside React’s normal render cycle and only touches React when it must. The win is keeping the loop and the rendering off the JS thread where possible, which is exactly what the animation libraries already solve, so a game loop hook is largely about borrowing that machinery for game state rather than reinventing a timer.
How do you actually drive the loop?
Not with setInterval or per-frame setState, which are the two classic mistakes:
| Approach | Verdict | Why |
|---|---|---|
| setInterval + setState | Wrong | Drops frames, floods the bridge, not frame-synced |
| requestAnimationFrame loop | Workable | Frame-synced, but state on the JS thread still costs |
| Reanimated worklets on the UI thread | Best for most | Runs the tick and updates off the JS thread |
| Skia + frame callback | Best for drawing-heavy games | GPU rendering with a real frame loop |
The right foundation is a frame-synced loop, and for most React Native games that means Reanimated (5,266,534 weekly downloads) running the per-frame update in a worklet on the UI thread, so the game state advances and the visuals update without crossing the bridge every frame. For drawing-heavy games, a Skia canvas with a frame callback handles rendering on the GPU, the same GPU-not-the-bridge approach as the kids tracing canvas. The game loop hook wraps this into a clean useGameLoop(callback) that fires the callback each frame with the delta time, which is the API a game developer actually wants.
Why is delta time the detail that matters?
Because frames are not evenly spaced, and ignoring that breaks the game on different devices. A naive loop that moves an object “5 pixels per frame” runs at different speeds on a 60Hz phone, a 120Hz ProMotion phone, and a phone dropping frames, so the universal fix is delta time: the loop measures how long since the last frame and scales movement by it (move at a speed per second, multiplied by the elapsed seconds), so the game runs at the same real-world speed regardless of frame rate. A game loop hook that does not pass delta time is subtly broken, and it is the single most important thing the hook provides beyond the tick itself.
This is the same frame-rate-independence discipline as any real-time animation, raised because a game’s correctness (not just smoothness) depends on it, the same off-the-JS-thread, time-based motion as the live-stream tip shower. A pause/resume capability and a fixed-timestep option for physics (where a variable timestep can make simulation unstable) round out a real game loop.
What completes a usable game loop hook?
The control and the honesty about scope. The hook needs start/stop/pause, so the loop is not running (and draining battery) when the game is not active, and it should stop on screen blur and resume on focus. And honest scope: React Native is fine for many games (puzzle, card, casual, simple action) but is not a game engine, so a genuinely demanding 3D or physics-heavy game belongs in a real engine, and the responsible framing is that a game loop hook makes 2D and casual games smooth, not that it turns React Native into Unity.
The screens, the game canvas, the HUD, the pause overlay, come as a free VP0 design, so an agent builds the Reanimated frame loop and delta-time hook onto a UI already shaped for a game surface with a HUD over it, rather than a setState loop that drops frames.
Key takeaways: a React Native game loop hook
- React’s event model fights a per-frame tick: setState 60 times a second melts the bridge; the loop runs outside React’s render cycle.
- Drive it frame-synced off the JS thread: Reanimated worklets for most games, Skia with a frame callback for drawing-heavy ones, not setInterval.
- Delta time is the critical detail: scale movement by elapsed time so the game runs at the same speed on 60Hz, 120Hz, and frame-dropping devices.
- The hook is useGameLoop(callback) with delta and controls: start, stop, pause, and stop-on-blur so it does not drain battery.
- Honest scope: great for 2D and casual games; a demanding 3D or physics game belongs in a real engine, not React Native.
Frequently asked questions
How do I build a game loop in React Native? Run a frame-synced loop off the JS thread, a Reanimated worklet for most games or a Skia frame callback for drawing-heavy ones, not setInterval with setState, and wrap it in a useGameLoop hook that fires each frame with delta time and offers start/stop/pause. A free VP0 design supplies the game canvas and HUD screens to build the loop into.
Why can’t I just use setInterval and setState for a game loop? Because setState 60 times a second floods the bridge and drops frames, and setInterval is not synced to the display’s refresh, so the game stutters. The per-frame update belongs off the JS thread (Reanimated worklets or Skia), touching React only when necessary, which is what keeps a real-time game smooth.
Other questions from VP0 builders
How do I build a game loop in React Native?
Run a frame-synced loop off the JS thread, a Reanimated worklet for most games or a Skia frame callback for drawing-heavy ones, not setInterval with setState, and wrap it in a useGameLoop hook that fires each frame with delta time and offers start/stop/pause. A free VP0 design supplies the game canvas and HUD screens to build the loop into.
Why can't I just use setInterval and setState for a game loop?
Because setState 60 times a second floods the bridge and drops frames, and setInterval is not synced to the display's refresh, so the game stutters. The per-frame update belongs off the JS thread (Reanimated worklets or Skia), touching React only when necessary, which is what keeps a real-time game smooth.
What is delta time and why does a game loop need it?
Delta time is the elapsed time since the last frame, and the loop scales movement by it so an object moves at a speed per second rather than per frame. Without it, a game runs at different speeds on 60Hz, 120Hz, and frame-dropping devices, which breaks correctness, not just smoothness, making delta time the most important thing the hook provides.
Is React Native good for building games?
For 2D, puzzle, card, casual, and simple action games, yes, with a proper frame-synced loop off the JS thread. It is not a game engine, though, so a demanding 3D or physics-heavy game belongs in a real engine like Unity or Godot. The honest framing is that a game loop hook makes casual games smooth, not that it turns React Native into a 3D engine.
Should the game loop keep running when the game is not active?
No: the hook needs start, stop, and pause, and should stop on screen blur and resume on focus, so the loop is not advancing state and draining battery when the game is off-screen or paused. A loop that runs continuously regardless of whether the game is active is a battery and correctness problem.
Part of the React Native & Expo: Mobile Frontend Architecture hub. Browse all VP0 topics →
Keep reading
Hero Animations in React Native: Shared Elements in 2026
Reanimated tags first, the manual overlay in your pocket: how shared element transitions actually work, and where the bridge breaks.
Live-Stream Tip Shower Animation in React Native
The gift rain is a business mechanic, not decoration: UI-thread particles, value encoded in spectacle, and a shower that only plays once the payment confirms.
Pinterest Waterfall Grid Masonry in React Native
Variable heights, packed tight, at 60fps: shortest-column placement, height reserved from aspect ratio to kill reflow, and FlashList virtualization.
React Native Bundle Size Optimization for AI Apps
AI apps bloat because agents add and never remove. Optimization is subtraction: measure with a visualizer, cut the heaviest libraries, lazy-load, right-size assets.
React Native MMKV Encrypted Storage Hook Template
A useState-like hook over fast, encrypted MMKV, with the encryption key in the Keychain, not hardcoded. The security lives in the key, not the library.
React Native New Architecture: The Bridgeless UI Reality
A bridgeless UI kit is just current components that avoid legacy-bridge assumptions. The work is dependency-first, not a new component language.