feat(tracing): Add Sentry.NavigationContainer wrapper for React Navigation #6199
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-48samples/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
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
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
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.