Skip to content

Commit

Permalink
fix: new arch working
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthak-d11 committed Nov 7, 2024
1 parent 2fbf618 commit 2bcea06
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/src/newarch/PerformanceTrackerModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PerformanceTrackerModule internal constructor(context: ReactApplicationCon
// Example method
// See https://reactnative.dev/docs/native-modules-android
@ReactMethod
override fun multiply(a: Double, b: Double): Double {
override fun multiply(a: Double, b: Double, promise: Promise?) {
Log.d("::: Shubham multiply", "" + Thread.currentThread())
return a * b;
}
Expand Down
5 changes: 4 additions & 1 deletion android/src/newarch/PerformanceTrackerViewManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ package com.performancetracker
import android.graphics.Color
import android.util.Log
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.PerformanceTrackerViewManagerInterface

@ReactModule(name = PerformanceTrackerViewManager.NAME)
class PerformanceTrackerViewManager :
PerformanceTrackerViewManagerSpec<PerformanceTrackerView>() {
SimpleViewManager<PerformanceTrackerView>(),
PerformanceTrackerViewManagerInterface<PerformanceTrackerView> {
override fun getName(): String {
return NAME
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,13 @@
},
"android": {
"javaPackageName": "com.performancetracker"
},
"includesGeneratedCode": true
}
},
"create-react-native-library": {
"type": "module-mixed",
"type": [
"module-mixed",
"view-mixed"
],
"languages": "kotlin-objc",
"version": "0.42.2"
}
Expand Down
3 changes: 2 additions & 1 deletion react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = {
dependency: {
platforms: {
android: {
cmakeListsPath: 'generated/jni/CMakeLists.txt',
cmakeListsPath:
'generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt',
},
},
},
Expand Down

0 comments on commit 2bcea06

Please # to comment.