From a493e7d8553ef014209c3550bf45c8f0b3471157 Mon Sep 17 00:00:00 2001 From: Marcin Herda Date: Sat, 11 May 2024 12:50:34 +0100 Subject: [PATCH] fixed minor typos and increased clarity --- docs/turbo-modules.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/turbo-modules.md b/docs/turbo-modules.md index 79fd85e..eeeede3 100644 --- a/docs/turbo-modules.md +++ b/docs/turbo-modules.md @@ -92,6 +92,8 @@ export default TurboModuleRegistry.get("RTNCalculator") as Spec | null; +Place the file in the `js` directory that we have just created, eg: `js/NativeRTNCalculator.ts`. + At the beginning of the spec files are the imports: - The `TurboModule` type, which defines the base interface for all Turbo Native Modules @@ -385,6 +387,7 @@ cd MyApp yarn add ../RTNCalculator cd .. node MyApp/node_modules/react-native/scripts/generate-codegen-artifacts.js \ + --targetPlatform ios \ --path MyApp/ \ --outputPath RTNCalculator/generated/ ``` @@ -449,7 +452,7 @@ Now add the Native code for your Turbo Native Module. Create two files in the `R NS_ASSUME_NONNULL_BEGIN -@interface RTNCalculator : NSObject +@interface RTNCalculator : NSObject @end @@ -475,7 +478,7 @@ RCT_EXPORT_MODULE() - (std::shared_ptr)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(params); + return std::make_shared(params); } @end @@ -848,7 +851,7 @@ export default App; import React from "react"; import { useState } from "react"; import { SafeAreaView, StatusBar, Text, Button } from "react-native"; -import RTNCalculator from "rtn-calculator/js/NativeCalculator"; +import RTNCalculator from "rtn-calculator/js/NativeRTNCalculator"; const App: () => JSX.Element = () => { const [result, setResult] = useState(null);