Skip to content

Commit

Permalink
fix(android): support react native 0.77 (#117)
Browse files Browse the repository at this point in the history
* fix(android): support react native 0.77

* chore: use null check instead of cast

* chore: add suppression comment for react native < 0.77
  • Loading branch information
believer authored Jan 27, 2025
1 parent 298aec7 commit c6d8b8f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ class TrueSheetViewManager : ViewGroupManager<TrueSheetView>() {
for (i in 0 until minOf(sizes.size(), 3)) {
when (sizes.getType(i)) {
ReadableType.Number -> result.add(sizes.getDouble(i))
ReadableType.String -> result.add(sizes.getString(i))
// React Native < 0.77 used String for getString, but 0.77
// changed it to String?. Suppress the error for older APIs.
@Suppress("UNNECESSARY_SAFE_CALL")
ReadableType.String -> sizes.getString(i)?.let { result.add(it) }
else -> Log.d(TAG, "Invalid type")
}
}
Expand Down

0 comments on commit c6d8b8f

Please sign in to comment.