GeezerVison is showing github.com — fix(mobile): custom header views no longer crash with "Couldn't find a navigation context" by nabettu · Pull Request #21547 · pingdotgg/t3code
Conversation
nabettu
commented
Oct 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
On current main, the iOS dev client shows a "Couldn't find a navigation context" render error at launch, thrown from NativeStackScreenOptions (StackHeader.tsx). Afterward the app reconnects unreliably and some navigation stops responding.
Since #21095, NativeHeaderToolbarRoot passes its toolbar items through optionsVersion, and optionsSignature walks them. Custom header views are React elements, so the walk went into element internals. In dev that includes the owner fiber, which reaches React Navigation's context default values. Those defaults throw from their getters.
The fix signs a React element by its type, key, and props instead of walking every field. A changed custom view still produces a new signature, so options are still reapplied.
A regression test in NativeHeaderToolbar.test.tsx renders a custom header view inside a component that reads a context whose default throws. It fails on main with the same error and passes with the fix.
| Before (main) |
After |
 |
 |
Verified on an iOS 27 simulator (iPhone 17 Pro) with the dev client: vp test run src/native/NativeHeaderToolbar.test.tsx, mobile typecheck, and lint.
Done with Claude Opus 5.5 in Claude Code (via T3 Code).
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…a navigation context"
Header option signatures walked into React elements, reaching dev-only
internals such as the owner fiber and React Navigation's context defaults,
whose getters throw. Sign elements by type, key, and props instead.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at 0ff8d38
Macroscope's review found this PR approvable — This is a narrowly scoped mobile crash fix that avoids traversing React element internals during navigation-option signature generation while preserving updates when element props change. The added regression test directly covers the reported context-default failure.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
49b38639-0d4f-42d4-b27a-f771c38ba7dc
📥 Commits
-
Reviewing files that changed from the base of the PR and between 1451e7c and 0ff8d38.
📒 Files selected for processing: 2
-
apps/mobile/src/native/NativeHeaderToolbar.test.tsx
apps/mobile/src/native/StackHeader.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
-
optionsSignature now signs React elements by type name, key, and props. A regression test checks that a custom native header toolbar renders beneath a context with a throwing default value.
Changes: Native Header Options
| Layer / File(s) |
Summary |
Element signatures and regression test apps/mobile/src/native/StackHeader.tsx, apps/mobile/src/native/NativeHeaderToolbar.test.tsx |
optionsSignature detects React elements and signs them using their type name, key, and props. The test expects a custom toolbar to produce a native header item with type custom. |
Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge, yash-singh1
Merge Risk: ⚪ Minimal · up to 0ff8d
-
The custom-header regression is covered, and no actionable merge risk remains after normal checks.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Title check |
 |
The title is concise, specific, and accurately describes the primary mobile fix for custom header views. |
| Description check |
 |
The description clearly covers the problem, root cause, fix, regression test, verification commands, simulator environment, and UI evidence. The Scope and approval section is not explicitly labeled or… |
Full details: Description check
-
Explanation
The description clearly covers the problem, root cause, fix, regression test, verification commands, simulator environment, and UI evidence. The Scope and approval section is not explicitly labeled or linked, but the focused bug fix is otherwise documented well enough to meet the template’s mostly complete standard.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
We hit this too immediately after pairing the iOS dev client (iPhone 17e simulator, iOS 27.0) against main at fb990765a4. We saw the same "Couldn't find a navigation context" render-error overlay from NativeStackScreenOptions / StackHeader.tsx.
Applying the StackHeader.tsx change from this PR (0ff8d38) cleared the error and let us open the thread and fork screens normally. This fixes the issue we observed.
I also verified the NativeHeaderToolbar.test.tsx regression: it fails with the same navigation-context error without the production change, and all 7 tests pass with it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
More evidence for this fix, from a different trigger. I'd opened #22517 with the same change before finding this PR, and I'm closing it as a duplicate.
Another way to hit it: submitting the Add environment sheet. While it connects, the ✓ becomes a Toolbar.Custom spinner, and the next options update crashes the same way. The dev pairing link (connections/new?…&autoConnect=1) submits as soon as the sheet opens, so .claude/skills/test-t3-mobile/scripts/pair-client.sh hit it on every run. Pairing still completes underneath the red box. SheetHeader's trailing and confirm.loading render the same kind of element.
Bisect: on dev clients of 7e289ae1f7, main with only NativeHeaderToolbar.tsx reverted to its pre-#21095 version paired cleanly, and unmodified main crashed. A temporary key-path trace showed the walk entering optionsVersion[0][0].element._owner and reading a context's _currentValue.getIsInitial.
Devices: with this signature change on ca140c435f, the pairing link connected with no red box and no Metro errors on an iPhone 18 Pro (iOS 27.0), an iPad Pro 11-inch (iPadOS 26.5) and a folded iPhone Duo (iOS 27.1). All three crashed on main.
Model: Claude Opus 5.5 | Harness: Claude Code in T3 Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note Grok responding on behalf of Julius.
Thanks for this! The same fix (signing React elements by type, key, and props instead of walking their internals) landed on main in #22521, so I am closing this as superseded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|