Skip to content

Fix React Native 0.83+ compatibility#13

Open
BenGWeeks wants to merge 3 commits into
Peach2Peach:mainfrom
BenGWeeks:fix/rn083-gettype-compat
Open

Fix React Native 0.83+ compatibility#13
BenGWeeks wants to merge 3 commits into
Peach2Peach:mainfrom
BenGWeeks:fix/rn083-gettype-compat

Conversation

@BenGWeeks
Copy link
Copy Markdown

Summary

Fixes Kotlin compilation errors when building with React Native 0.83+ (Gradle 9.0):

  • Replace Dynamic.getType() with .type property access (method was removed in RN 0.83)
  • Add non-null assertions for ReadableArray.getMap() which now returns ReadableMap? instead of ReadableMap
  • Remove prepare script that runs yarn compile (fails when installed via github: reference)

Context

Same fix as LtbLightning/bdk-rn#87 submitted to the upstream repo, but that PR doesn't appear to be getting reviewed — the upstream repo hasn't merged anything since Jan 2024.

These changes are backwards-compatible with older RN versions — .type was always available as a property, and !! assertions are harmless on non-nullable types.

Testing

  • Kotlin compilation succeeds on RN 0.83.4 / Gradle 9.0
  • Tested in Lightning Piggy React Native app

🤖 Generated with Claude Code

BenGWeeks and others added 3 commits April 4, 2026 15:50
Dynamic.getType() was removed in RN 0.83 (Gradle 9.0). Replace with
property access .type which works across RN versions.

Same fix as LtbLightning#87 (submitted to upstream but not
merged — upstream appears unmaintained since Jan 2024).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The prepare script runs yarn compile (tsc) which fails when
installed via github: reference because devDependencies aren't
available. Pre-compile and commit lib/ directory instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RN 0.83 changed ReadableArray.getMap() to return ReadableMap? (nullable)
instead of ReadableMap. Add non-null assertions where values are
guaranteed to exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BenGWeeks added a commit to BenGWeeks/lightning-piggy-mobile that referenced this pull request Apr 4, 2026
Replace manual Electrum JSON-RPC + bitcoinjs-lib tx parsing with BDK
native Rust library (forked from Peach2Peach/bdk-rn with RN 0.83 fix).

BDK provides in a single sync call:
- Correct balance (confirmed + unconfirmed)
- Transaction history with accurate sent/received amounts
- Proper incoming/outgoing direction detection
- Block heights for confirmed transactions
- Native Rust performance (no fragile JS TCP sockets)

onchainService.ts: 370 lines → 210 lines
Removes need for: manual address scanning, raw tx parsing, input
amount lookups, rate limiting, connection keepalive handling

Uses github:BenGWeeks/bdk-rn#fix/rn083-gettype-compat
PR submitted to Peach: Peach2Peach/bdk-rn#13

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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