Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Sentry React Native JS Hang Tracking

Sentry React Native 8.34 adds JS hang tracking and long task metrics. Learn React Native JS hang tracking to find frozen screens crashes miss.

· 3 min read

A React Native app can look healthy on every dashboard and still feel broken. The JavaScript thread freezes for a second, taps do nothing, and the user leaves. No crash is logged, so your crash-free rate stays at 99.9% while retention quietly drops.

Sentry React Native 8.34.0 targets exactly this gap. It adds experimental enableJsHangTracking, which reports JavaScript thread hangs on iOS as errors. It also adds longTaskIntegration, which reports JS long tasks as a metric. That integration needs React Native 0.82 or later with the New Architecture. The release also adds JavaScript (Hermes) samples to UI profiles on Android 15 and later.

Why JS Hangs Matter

The JS thread runs your business logic, state updates and navigation. When one task blocks it, touch handling stalls even though the native UI is fine. Users describe this as “laggy” or “unresponsive” rather than “crashed”, so it rarely appears in support tickets with useful detail.

Data Points to Track

  • hang_duration_ms for each reported JS hang
  • screen_name or route active when the hang began
  • app_version and sdk_version
  • rn_version and whether the New Architecture is enabled
  • os_name, os_version and device_model
  • long_task_count per session
  • long_task_p95_ms per screen
  • user_action_before_hang (for example, list scroll or form submit)
  • session_exit_after_hang as a boolean

Setup Steps

  1. Upgrade @sentry/react-native to 8.34.0 or later and rebuild the native app.
  2. Confirm your React Native version is 0.82 or later with the New Architecture if you want long task metrics.
  3. Set enableJsHangTracking: true in Sentry.init. It is experimental, so enable it for a small share of users first.
  4. Add longTaskIntegration to your integrations list.
  5. Tag releases and environments so hangs can be compared across builds.
  6. Create a saved view that groups hangs by screen and release.
  7. Send a custom event when a session ends within 30 seconds of a hang, so you can measure the impact on retention.

Actionable Insights

Rank screens by long task p95 rather than by average. Averages hide the rare two-second freeze that users actually notice.

Compare hang rates before and after each release. A jump usually traces back to a new list, a heavy JSON parse or a state update that re-renders too much.

Link hangs to exits. If sessions that contain a hang end sooner or convert less, you have a business case for performance work, not just an engineering preference.

Keep in mind that the iOS hang reporting is experimental. Treat early numbers as directional, and validate a suspected hot spot with a profile before you rewrite code.

Common Mistakes to Avoid

Do not enable every option for every user on day one. Hang tracking is experimental, and extra instrumentation on the JS thread has a cost of its own, so roll it out gradually and watch your own performance numbers.

Do not blame the device. Low-end Android phones hang more often, but a hang that appears on every device points to your code. Segment by device tier before deciding where to invest.

Do not ignore the New Architecture split. Long task metrics only exist for apps on React Native 0.82 or later with it enabled, so a missing chart on older builds is expected, not a bug.