From b061293b8497a43c2732b18684ad20e81c15a4f1 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Sat, 9 Dec 2023 13:19:52 +0100 Subject: [PATCH] fix: Fix adding custom `ReactPackage`s in Kotlin template The previous comment in the template used Java, this has now been updated to Kotlin. --- .../app/src/main/java/com/helloworld/MainApplication.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt index 5c868b449d9087..11bf4c94ec3c81 100644 --- a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt +++ b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt @@ -16,9 +16,10 @@ class MainApplication : Application(), ReactApplication { override val reactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) { override fun getPackages(): List { + val packages = PackageList(this).packages // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - return PackageList(this).packages + // packages.add(MyReactNativePackage()) + return packages } override fun getJSMainModuleName(): String = "index"