fix(mobile): adding an environment no longer crashes while connecting

Tapping connect on Add environment swaps the checkmark for a spinner, a
custom header item. Since #21095 the toolbar's items feed the native stack
options signature, which walked every enumerable field. In development a
React element's `_owner` is a fiber, so the walk climbed the whole tree
to React Navigation's NavigationStateContext. Outside render that context
holds its default value, whose getters throw "Couldn't find a navigation
context". The red box pointed at StackHeader.tsx:148 only because that is
the component frame for NativeStackScreenOptions.

The options helpers no longer walk React's internals. Elements are compared
by type, key, and props. Component types and contexts are compared by
identity and kept as-is when header factories are stabilized. Sheet headers
with trailing or loading custom items went through the same path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aaa7380015Julius Marminge committed on 10/20/2026, 9:47:27 PMparentca140c4

Checks

All checks passed
2 files changedLine totals unavailable