Update for React Native 0.78+ Compatibility: Enforce Stricter Kotlin Checks & Migrate to setViewTreeLifecycleOwner API#3816
Conversation
… potential crashes
mfazekas
left a comment
There was a problem hiding this comment.
Thanks much for the PR!, can you please add error logging ? So we don't just skip processing when it's null but we log some error. I think non of the changed place is expected to be null
…fecycle management
…s to improve error logging
Added Error Logs |
…le for improved debugging
|
@ShahilMangroliya Can you update the description? Is this PR to prevent crashes? Or to enable building with 0.78.1, which has more strict kotlin checking I assume |
…leMap with logging for better debugging
Updated description |
Done |
|
Can we approve this please? |
|
@mfazekas Much needed PR. Can we expedite the process, or how can I help? |
| import android.view.View | ||
| import com.facebook.react.bridge.* | ||
| import com.facebook.react.common.MapBuilder | ||
| //import com.facebook.react.common.MapBuilder |
There was a problem hiding this comment.
pls remove instead of commenting
| ReadableType.Boolean -> Expression.literal(expressions.getBoolean(iExp)) | ||
| ReadableType.Number -> Expression.literal(expressions.getDouble(iExp)) | ||
| else -> Expression.literal(expressions.getString(iExp)) | ||
| else -> expressions.getString(iExp)?.let { Expression.literal(it) }!! |
There was a problem hiding this comment.
Can we add a log here as well?
| when (getType(i)) { | ||
| ReadableType.Map -> result.add(getMap(i).toJsonObject()) | ||
| ReadableType.Array -> result.add(getArray(i).toJsonArray()) | ||
| ReadableType.Map -> result.add(getMap(i)?.toJsonObject()) |
|
@ShahilMangroliya pls look into ci failures as well |
|
@mfazekas @ShahilMangroliya Guys, let's speed up the process please. Too many people are waiting for this. |
|
See: #3855 it's released as |
Description
fix(android): support RN 0.78.0+
This PR addresses compatibility with React Native 0.78.0+ by enforcing stricter Kotlin checks, which are required for RN 0.78.0+. These changes ensure the module works reliably with the newer RN versions and prevent potential crashes due to Kotlin mismatch or type-safety issues.
Additionally, this PR updates the usage of
ViewTreeLifecycleOwner.set(view, lifecycleOwner);to the newer and preferred API:view.setViewTreeLifecycleOwner(lifecycleOwner).Fixes #3815
Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)