Skip to content

fix(core): Call onReady in NavigationContainer fallback path

fc3fa41
Select commit
Loading
Failed to load commit list.
Open

feat(tracing): Add Sentry.NavigationContainer wrapper for React Navigation #6199

fix(core): Call onReady in NavigationContainer fallback path
fc3fa41
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed May 21, 2026 in 5m 59s

1 issue

find-bugs: Found 1 issue (1 medium)

Medium

Fallback `useEffect` re-calls `userOnReady` on every render when `onReady` is an unstable reference - `packages/core/src/js/NavigationContainer.tsx:69-73`

The useEffect at line 69 lists userOnReady as a dependency, so it re-fires—calling the user's onReady callback again—every time the parent re-renders with a new inline function reference, which is the common case.

Also found at:

  • packages/core/test/NavigationContainer.missing.test.tsx:42-48
  • samples/react-native-macos/src/App.tsx:172

⏱ 5m 33s · 443.7k in / 55.0k out · $1.68

Annotations

Check warning on line 73 in packages/core/src/js/NavigationContainer.tsx

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

Fallback `useEffect` re-calls `userOnReady` on every render when `onReady` is an unstable reference

The `useEffect` at line 69 lists `userOnReady` as a dependency, so it re-fires—calling the user's `onReady` callback again—every time the parent re-renders with a new inline function reference, which is the common case.

Check warning on line 48 in packages/core/test/NavigationContainer.missing.test.tsx

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

[NMD-VZH] Fallback `useEffect` re-calls `userOnReady` on every render when `onReady` is an unstable reference (additional location)

The `useEffect` at line 69 lists `userOnReady` as a dependency, so it re-fires—calling the user's `onReady` callback again—every time the parent re-renders with a new inline function reference, which is the common case.

Check warning on line 172 in samples/react-native-macos/src/App.tsx

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

[NMD-VZH] Fallback `useEffect` re-calls `userOnReady` on every render when `onReady` is an unstable reference (additional location)

The `useEffect` at line 69 lists `userOnReady` as a dependency, so it re-fires—calling the user's `onReady` callback again—every time the parent re-renders with a new inline function reference, which is the common case.