Skip to content

Commit 62629b3

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate ReactNativeHost from Java to Kotlin
Summary: Mechanical migration of the deprecated `ReactNativeHost` class from Java to Kotlin. All methods retain their exact JVM signatures to preserve API compatibility. Key migration decisions: - Class remains `abstract` (implicitly open) - All non-final, non-abstract methods marked `open` to match Java virtual-by-default - `getApplication()` remains `final` (no `open`) - Methods kept as explicit `fun` (not Kotlin properties) to preserve exact JVM getter names like `getJSMainModuleName()`, `getJSBundleFile()`, `getUIManagerProvider()` - `Nullable` return types converted to Kotlin nullable types (`?`) - `synchronized` methods use `Synchronized` annotation - `Nullsafe` annotation removed (redundant in Kotlin) - Static initializer converted to companion object `init` block Changelog: [Android][Changed] - Migrate `ReactNativeHost` from Java to Kotlin (no behavioral changes) Reviewed By: javache Differential Revision: D105013283
1 parent 7339aed commit 62629b3

4 files changed

Lines changed: 221 additions & 259 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public open class ReactDelegate {
249249
((ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture() &&
250250
reactHost?.devSupportManager != null) ||
251251
(reactNativeHost?.hasInstance() == true &&
252-
reactNativeHost?.useDeveloperSupport == true))
252+
reactNativeHost?.getUseDeveloperSupport() == true))
253253
) {
254254
event.startTracking()
255255
return true
@@ -270,7 +270,8 @@ public open class ReactDelegate {
270270
}
271271
} else {
272272
if (
273-
reactNativeHost?.hasInstance() == true && reactNativeHost?.useDeveloperSupport == true
273+
reactNativeHost?.hasInstance() == true &&
274+
reactNativeHost?.getUseDeveloperSupport() == true
274275
) {
275276
reactNativeHost?.reactInstanceManager?.showDevOptionsDialog()
276277
return true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)