# fix\(mobile\): connecting an environment no longer crashes the header · PR \#22521 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22521)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: duo/navigation

Target branch: main

Head commit: aaa7380015abcf64411a887d28a596b52367001c

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22521)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22521/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22521/diffs?format=markdown)

## Description

---

Connecting a new environment can crash development builds with “Couldn't find a navigation context” when the header checkmark becomes a loading indicator. The toolbar options comparison follows the React element's development-only owner into React Navigation's context.

Compare React elements by type, key, and props, and preserve React component/context objects by identity. This keeps equivalent toolbar updates stable without traversing React internals. It also covers custom content in sheet headers.

Verification: 14 focused toolbar and pairing tests pass. The new regression test exercises a custom toolbar element beneath a context with a throwing default, including equivalent renders and changed content. On the iPhone Duo simulator, auto-connect reaches normal connection-error handling without the navigation render error. No visual styling changes.

Implemented by Claude Opus 5.5 through the T3 Code Claude harness; reviewed and verified by GPT-6.1 through the Codex harness.

