Skip to content

fix(ios): resolve instant launch crash and header tap-to-scroll conflict on iOS 26+ - #20

Merged
sporaktu merged 2 commits into
masterfrom
fix/ios-context-menu-launch-crash
Jul 3, 2026
Merged

fix(ios): resolve instant launch crash and header tap-to-scroll conflict on iOS 26+#20
sporaktu merged 2 commits into
masterfrom
fix/ios-context-menu-launch-crash

Conversation

@sporaktu

@sporaktu sporaktu commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

TestFlight v4.0.3(6) crashed instantly on launch with an uncaught NSUnknownKeyException:

[<RCTView> valueForUndefinedKey:]: this class is not key value coding-compliant for the key reactPropHandler.

Root cause: react-native-ios-utilities@5.1.2 / react-native-ios-context-menu@3.1.0 (zeego's iOS backend) declare codegenConfig.componentProvider at the wrong level — RN moved it under codegenConfig.ios. Codegen never maps RNIContextMenuView/RNIDetachedView to native classes, Fabric falls back to a plain RCTView, and the libraries' Paper-era prop remap (RCT_REMAP_VIEW_PROPERTY(prop, reactPropHandler.prop, …)) KVCs against it and aborts. The home feed wraps every post in a zeego context menu, so the app died on first render. v4.0.3 was the first iOS binary to contain zeego (v4.0.2 never cleared pod install), which is why the crash appeared now.

Second fix riding along: iOS 26+ added a system nav-bar tap-to-scroll-to-top gesture that RN Pressables can't consume, so tapping the subreddit switcher title opened the menu and scrolled the feed to top.

Changes

  • Pin react-native-ios-utilities@5.2.0 (contains upstream PR #27) and react-native-ios-context-menu@3.2.1, which nest componentProvider under ios. Exact pins (no caret) because upstream publishes are source-only and drift is unsafe.
  • npm overrides so zeego 3.0.6's exact peer pins resolve to the bumped versions — without them npm ci fails ERESOLVE on EAS.
  • patch-package + postinstall: patch react-native-screens@4.23.0 with a backport of unreleased software-mansion/react-native-screens#3731 — a guard UITapGestureRecognizer on header title/center subviews that defeats the system scroll-to-top for taps on the custom title only. Applied on all idioms (behavior exists on iPhone in iOS 26/27; upstream gates to iPad) without the new codegen prop.
  • The eas.json RN-from-source env vars remain required: riu 5.2.0's podspec still hard-depends on the RCT-Folly pod (the guarded fix is only in the unpublished v5.2.1 tag).

Test Plan

  • Local Release build (RN from source, matching the production profile env) installed on iPhone (iOS 27): app launches and stays alive — previously aborted <1s
  • Feed renders; long-press native context menus on posts work (exercises the bumped libraries)
  • Subreddit-name tap opens the switcher without scrolling; tapping elsewhere in the top bar still scrolls to top
  • jest 171/171, tsc clean
  • Clean-room npm ci from the new lockfile: resolves 5.2.0/3.2.1 (no ERESOLVE error) and postinstall applies the RNS patch
  • EAS production build + TestFlight smoke test after merge (cut v4.0.4)

🤖 Generated with Claude Code

sporaktu and others added 2 commits July 2, 2026 22:00
… launch crash

TestFlight v4.0.3(6) aborted on launch with an uncaught
NSUnknownKeyException: [<RCTView> valueForUndefinedKey:]: this class is
not key value coding-compliant for the key reactPropHandler.

react-native-ios-utilities 5.1.2 and react-native-ios-context-menu 3.1.0
declare codegenConfig.componentProvider at the top level, but RN moved it
under codegenConfig.ios. Codegen therefore never maps RNIContextMenuView/
RNIDetachedView/etc to their native classes, Fabric falls back to a plain
RCTView, and the libraries' Paper-era prop remap
(RCT_REMAP_VIEW_PROPERTY(prop, reactPropHandler.prop, ...)) does KVC
against that RCTView and throws. The home feed wraps every post in a
zeego context menu, so the app died on first render.

Fix: pin react-native-ios-utilities 5.2.0 (contains upstream PR #27) and
react-native-ios-context-menu 3.2.1, both of which nest componentProvider
under ios. zeego 3.0.6 exact-pins the broken versions as peers, so npm
overrides redirect them; without the overrides npm ci fails ERESOLVE on
EAS. Versions are pinned exactly (no caret) because upstream publishes
are source-only (resolve via the react-native field) and drift is unsafe.

The eas.json RN-from-source env vars are still required: 5.2.0's podspec
still hard-depends on the RCT-Folly pod.

Verified: local Release build to iPhone launches and stays alive, feed
renders, long-press native context menus work; jest 171/171; tsc clean;
npm ci from the new lockfile resolves 5.2.0/3.2.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dit switcher title

iOS 26+ added a system gesture (_UIDoubleTapInteractionGestureRecognizer on
UIWindow/UINavigationBar) that scrolls the active scroll view to top when the
navigation bar is tapped. RN Pressables can't consume it, so tapping the
subreddit name in the header opened the switcher AND scrolled the feed to top.

Patch react-native-screens 4.23.0 (via patch-package) with a backport of the
essence of upstream PR software-mansion/react-native-screens#3731 (unreleased):
a no-op guard UITapGestureRecognizer on header title/center subviews that all
outside tap recognizers must wait on, so taps on the custom title defeat the
system scroll-to-top while taps elsewhere on the bar keep it. Differences from
upstream: applied on all idioms (the behavior exists on iPhone in iOS 26/27,
upstream currently gates to iPad) and applied unconditionally to title/center
subviews instead of plumbing a new codegen prop.

Verified on device (iPhone, iOS 27): subreddit-name tap opens the switcher
without scrolling; tapping elsewhere in the top bar still scrolls to top.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sporaktu
sporaktu merged commit 5e7e2d9 into master Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant