Fix React Native 0.83+ compatibility (getType + ReadableMap nullable)#88
Open
BenGWeeks wants to merge 2 commits into
Open
Fix React Native 0.83+ compatibility (getType + ReadableMap nullable)#88BenGWeeks wants to merge 2 commits into
BenGWeeks wants to merge 2 commits into
Conversation
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>
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>
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.
Summary
Two small compatibility fixes to keep
bdk-rnworking on React Native 0.83+:getType()→.type— RN 0.83 deprecatedgetType()on bridge value classes (ReadableMap,ReadableArray) in favour of the.typeKotlin property. The old method still works at runtime today but emits a deprecation warning in 0.83 and will be removed in a future RN.ReadableMap.getMap()is now nullable — RN 0.83 changed the Java/Kotlin signature ofReadableMap.getMap(String)fromReadableMaptoReadableMap?. Without the!!(or null-safe handling) the Kotlin compiler errors with type-mismatch when the result is passed into a function expecting non-null. Three call sites needed adjustment inBdkRnModule.kt.Test
Tested locally against React Native 0.83.4 + Expo SDK 55 inside the
lightning-piggy-mobileconsumer:Compatibility
The patch is forward-compatible with RN 0.83+. For RN ≤0.82, the
.typeaccessor exists too (added in RN 0.71 or thereabouts), so this shouldn't break older consumers — but I haven't tested against RN 0.81/0.82 specifically. If maintainers have a preferred minimum-RN-version policy, happy to gate this with a version check or follow whichever approach lines up best.Carrier
These commits have been carried in our Lightning Piggy fork (
BenGWeeks/bdk-rn#lightning-piggy) since early April 2026 and have been running in dev builds without issue. Filing upstream now since the upstream version is the right home and RN 0.83+ is becoming the default for new SDK 55 projects.