From e28ed126858cae42be4f2704ee88df910a80451f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nishan=20=28o=5E=E2=96=BD=5Eo=29?= Date: Fri, 19 Aug 2022 15:20:48 +0530 Subject: [PATCH] nit: fix typo in new architecture docs (#3261) * fix typo * fix: typescript example * fix: lint * make text optional --- docs/the-new-architecture/pillars-codegen.md | 4 ++-- docs/the-new-architecture/pillars-fabric-components.md | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/the-new-architecture/pillars-codegen.md b/docs/the-new-architecture/pillars-codegen.md index f7510cff97f..c55db88d267 100644 --- a/docs/the-new-architecture/pillars-codegen.md +++ b/docs/the-new-architecture/pillars-codegen.md @@ -114,7 +114,7 @@ In the example above, there are both a TurboModule and a set of Fabric Component Each TurboModule's folder contains two files: an interface file and an implementation file. -The interface files have the same name of the TurboModule and they contain methods to initialize their the JSI interface. +The interface files have the same name of the TurboModule and they contain methods to initialize the JSI interface. The implementation files, instead, have the `-generated` suffix and they contains the logic to invoke the native methods from JS and viceversa. @@ -218,7 +218,7 @@ Notice that both TurboModules and Fabric Components comes with two build file de ### TurboModule -The **Codegen** generates a Java abstract class in the `java` package which the same name of the TurboModule. This abstract class has to be implemented by the JNI C++ implementation. +The **Codegen** generates a Java abstract class in the `java` package with the same name of the TurboModule. This abstract class has to be implemented by the JNI C++ implementation. Then, it generates the C++ files in the `jni` folder. They follow the same iOS convention: there is an interface called `MyTurbomodule.h` and an implementation file called `MyTurbomodule-generated.cpp`. The former is an interface that allows React Natvie to initialize the JSI interface for the TurboModule. The latter is the implementation file which contains the logic to invoke the native method from JS and viceversa. diff --git a/docs/the-new-architecture/pillars-fabric-components.md b/docs/the-new-architecture/pillars-fabric-components.md index 03d7afc3082..a4271e49985 100644 --- a/docs/the-new-architecture/pillars-fabric-components.md +++ b/docs/the-new-architecture/pillars-fabric-components.md @@ -96,8 +96,7 @@ import type { HostComponent } from 'react-native'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; export interface NativeProps extends ViewProps { - ...ViewProps, - text: string | null | undefined, + text?: string; // add other props here }