Skip to content

Fixed code on sample turbo module in android #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/turbo-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Turbo Native Modules are the next iteration on Native Modules that provide a few
At a high-level the steps for writing a Turbo Module are:

1. Define a JavaScript specification using Flow or TypeScript.
1. Configure the dependencies management system to generate code from the provided spec.
1. Implement the Native code.
1. Integrate the code in the app.
2. Configure the dependencies management system to generate code from the provided spec.
3. Implement the Native code.
4. Integrate the code in the app.

This guide will show you how to create a basic Turbo Native Module compatible with the latest version of React Native.

Expand Down Expand Up @@ -521,7 +521,7 @@ codegen
├── java
│ └── com
│ └── rtncalculator
│ └── NativeCalculatorSpec.java
│ └── NativeRTNCalculatorSpec.java
├── jni
│ ├── Android.mk
│ ├── CMakeLists.txt
Expand Down Expand Up @@ -579,9 +579,9 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import java.util.Map;
import java.util.HashMap;
import com.rtncalculator.NativeCalculatorSpec;
import com.rtncalculator.NativeRTNCalculatorSpec;

public class CalculatorModule extends NativeCalculatorSpec {
public class CalculatorModule extends NativeRTNCalculatorSpec {

public static String NAME = "RTNCalculator";

Expand Down Expand Up @@ -611,9 +611,9 @@ package com.rtncalculator

import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.rtncalculator.NativeCalculatorSpec
import com.rtncalculator.NativeRTNCalculatorSpec

class CalculatorModule(reactContext: ReactApplicationContext) : NativeCalculatorSpec(reactContext) {
class CalculatorModule(reactContext: ReactApplicationContext) : NativeRTNCalculatorSpec(reactContext) {

override fun getName() = NAME

Expand All @@ -629,7 +629,7 @@ class CalculatorModule(reactContext: ReactApplicationContext) : NativeCalculator

</details>

This class implements the module itself, which extends the `NativeCalculatorSpec` that was generated from the `NativeCalculator` JavaScript specification file.
This class implements the module itself, which extends the `NativeRTNCalculatorSpec` that was generated from the `NativeCalculator` JavaScript specification file.

##### Updating the `CalculatorPackage.java`

Expand Down