fix(ios): patch react-native-keys for bridgeless (RN 0.85) linking - #59
Merged
Conversation
react-native-keys@0.7.13 detects the New Architecture via `global.__turboModuleProxy != null`, which is null under RN 0.84+ BRIDGELESS mode (the SDK 56 / RN 0.85 default). It then falls back to NativeModules.Keys, which is nil in bridgeless, so iOS throws "react-native-keys doesn't seem to be linked" at startup (which also blocks app registration → 'main not registered'). Android happened to slip past it. Extend the existing yarn patch to also treat `global.RN$Bridgeless === true` as TurboModule-enabled, so the TurboModule spec is used and the module resolves. Matches numandev1/react-native-keys#123. Verified the full patch applies cleanly against a pristine 0.7.13. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWjhmaeq8DnsiiFD9Eg7A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes the iOS runtime error:
Root cause:
react-native-keys@0.7.13decides whether to use the TurboModule viaglobal.__turboModuleProxy != null(src/index.ts). Under RN 0.84+ bridgeless mode — the default on Expo SDK 56 / RN 0.85 —__turboModuleProxyisnulleven though TurboModules are enabled, so it falls back toNativeModules.Keys, which is nil in bridgeless. Result: the linking error at startup, which also aborts app registration (→ the secondary"main" not registerederror). Android slips past this check, which is why only iOS broke.Fix: extend the existing
react-native-keysyarn patch so the detection also treatsglobal.RN$Bridgeless === trueas TurboModule-enabled, so the TurboModule spec (TurboModuleRegistry.getEnforcing('Keys')) is used and the module resolves.Verified the full patch (existing Android hunks + new
src/index.tshunk) applies cleanly against a pristine0.7.13.Verify locally
🤖 Generated with Claude Code
Generated by Claude Code