The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): opening a pull request no longer crashes with "Maximum update depth exceeded" (#22600)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
tatsuaki watanabe committed
Oct 22, 2026 at 06:12 UTC
d0c5d7c4ed90c9018e41853cde4f10043c72b12a
1 file changed
+13
-3
apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+13
-3
@@ -299,6 +299,18 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
299
const [headerHeight, setHeaderHeight] = useState(0);
300
const [viewportHeight, setViewportHeight] = useState(0);
301
const scrollViews = useRef<Partial<Record<typeof section, LegendListRef | null>>>({});
302
+ // AnimatedLegendList re-attaches its handle and sets state whenever its ref changes,
303
+ // so an inline ref in the tab map loops the screen into "Maximum update depth exceeded".
304
+ const [listRefs] = useState(() => {
305
+ const listRef = (tab: typeof section) => (list: LegendListRef | null) => {
306
+ scrollViews.current[tab] = list;
307
+ };
308
+ return {
309
+ overview: listRef("overview"),
310
+ guide: listRef("guide"),
311
+ activity: listRef("activity"),
312
+ };
313
+ });
314
const selectSection = (next: typeof section) => {
315
if (next === section) return;
316
scrollOffsets.current[section] = currentScrollOffset.current;
@@ -545,9 +557,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
557
importantForAccessibility={section === tab ? "auto" : "no-hide-descendants"}
558
>
559
<AnimatedLegendList
548
- ref={(list) => {
549
- scrollViews.current[tab] = list;
550
- }}
560
+ ref={listRefs[tab]}
561
initialScrollOffset={-insets.top}
562
onScroll={(event) => {
563
const offset = event.nativeEvent.contentOffset.y;