From ac2ad82ed6bbd4205e69d369caec0af5d866426d Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 1 Mar 2022 18:09:30 +0000 Subject: [PATCH 1/2] Use diff syntax for codeblocks --- docs/new-architecture-app-intro.md | 50 +++-- docs/new-architecture-app-modules-android.md | 178 ++++++++--------- docs/new-architecture-app-modules-ios.md | 8 +- docs/new-architecture-app-renderer-android.md | 188 +++++++++--------- docs/new-architecture-library-android.md | 4 +- 5 files changed, 208 insertions(+), 220 deletions(-) diff --git a/docs/new-architecture-app-intro.md b/docs/new-architecture-app-intro.md index 84b6b5e2bfb..026f3c43702 100644 --- a/docs/new-architecture-app-intro.md +++ b/docs/new-architecture-app-intro.md @@ -72,53 +72,51 @@ ls -la node_modules/react-native-gradle-plugin Now, you can edit your **top level** `settings.gradle` file to include the following line at the end of the file: -```groovy -includeBuild('../node_modules/react-native-gradle-plugin') +```diff title='android/settings.gradle' + include ':app' ++includeBuild('../node_modules/react-native-gradle-plugin') -include(":ReactAndroid") -project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') ++include(":ReactAndroid") ++project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') ``` Then, edit your **top-level Gradle file** to include the highlighted lines: -```groovy +```diff title='android/build.gradle' buildscript { // ... dependencies { // Make sure that AGP is at least at version 7.x - classpath("com.android.tools.build:gradle:7.0.4") +- classpath("com.android.tools.build:gradle:4.2.2") ++ classpath("com.android.tools.build:gradle:7.0.4") - // Add those lines - classpath("com.facebook.react:react-native-gradle-plugin") - classpath("de.undercouch:gradle-download-task:4.1.2") ++ classpath("com.facebook.react:react-native-gradle-plugin") ++ classpath("de.undercouch:gradle-download-task:4.1.2") } } ``` Edit your **module-level** **Gradle file** (usually `app/build.gradle[.kts]`) to include the following: -```groovy -apply plugin: "com.android.application" +```diff title='android/app/settings.gradle' + apply plugin: "com.android.application" -// Add those lines -apply plugin: "com.facebook.react" -// Add those lines as well -react { - reactRoot = rootProject.file("../node_modules/react-native/") - codegenDir = rootProject.file("../node_modules/react-native-codegen/") -} ++apply plugin: "com.facebook.react" + ++react { ++ reactRoot = rootProject.file("../node_modules/react-native/") ++ codegenDir = rootProject.file("../node_modules/react-native-codegen/") ++} ``` Finally, it’s time to update your project to use the `react-native` dependency from source, rather than using a precompiled artifact from the NPM package. This is needed as the later setup will rely on building the native code from source. Let’s edit your **module level** `build.gradle` (the one inside `app/` folder) and change the following line: -```groovy +```diff title='android/app/build.gradle' dependencies { - // Replace this: - implementation "com.facebook.react:react-native:+" // From node_modules - // With this: - implementation project(":ReactAndroid") // From node_modules +- implementation "com.facebook.react:react-native:+" // From node_modules ++ implementation project(":ReactAndroid") // From node_modules ``` ## Use Hermes @@ -173,7 +171,7 @@ In order to set up the TurboModule system, you will add some code to interact wi Now you will have your AppDelegate conform to `RCTCxxBridgeDelegate`. Start by adding the following imports at the top of your AppDelegate file: -```objc +```objc title='AppDelegate.mm' #import #import #import @@ -181,7 +179,7 @@ Now you will have your AppDelegate conform to `RCTCxxBridgeDelegate`. Start by a Then, declare your app delegate as a `RCTCxxBridgeDelegate` provider: -```objc +```objc title='AppDelegate.mm' @interface AppDelegate () { // ... } @@ -192,7 +190,7 @@ To conform to the `RCTCxxBridgeDelegate` protocol, you will need to implement th You can implement the `jsExecutorFactoryForBridge:` method like this: -```objc +```objc title='AppDelegate.mm' #pragma mark - RCTCxxBridgeDelegate - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge diff --git a/docs/new-architecture-app-modules-android.md b/docs/new-architecture-app-modules-android.md index d291b555a9d..c9310f47a1a 100644 --- a/docs/new-architecture-app-modules-android.md +++ b/docs/new-architecture-app-modules-android.md @@ -25,68 +25,65 @@ The code-gen will output some Java and some C++ code that now we need to build. Let’s edit your **module level** `build.gradle` to include the **two** `externalNativeBuild` blocks detailed below inside the `android{}` block: -```groovy +```diff title='android/app/build.gradle' android { defaultConfig { applicationId "com.awesomeproject" - // ... - - // Add this block - externalNativeBuild { - ndkBuild { - arguments "APP_PLATFORM=android-21", - "APP_STL=c++_shared", - "NDK_TOOLCHAIN_VERSION=clang", - "GENERATED_SRC_DIR=$buildDir/generated/source", - "PROJECT_BUILD_DIR=$buildDir", - "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", - "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build" - cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" - cppFlags "-std=c++17" - targets "myapplication_appmodules" - } - } - } - // Add this block - externalNativeBuild { - ndkBuild { - path "$projectDir/src/main/jni/Android.mk" - } ++ externalNativeBuild { ++ ndkBuild { ++ arguments "APP_PLATFORM=android-21", ++ "APP_STL=c++_shared", ++ "NDK_TOOLCHAIN_VERSION=clang", ++ "GENERATED_SRC_DIR=$buildDir/generated/source", ++ "PROJECT_BUILD_DIR=$buildDir", ++ "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", ++ "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build" ++ cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" ++ cppFlags "-std=c++17" ++ targets "myapplication_appmodules" ++ } ++ } } + ++ externalNativeBuild { ++ ndkBuild { ++ path "$projectDir/src/main/jni/Android.mk" ++ } ++ } } ``` In the same `build.gradle` file, inside the same `android{}` let’s add also the following section: -```groovy +```diff title='android/app/build.gradle' android { // ... - def reactAndroidProjectDir = project(':ReactAndroid').projectDir - def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkLibsForBuck") - dependsOn("generateCodegenArtifactsFromSchema") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - - afterEvaluate { - preBuild.dependsOn(packageReactNdkLibs) - configureNdkBuildDebug.dependsOn(preBuild) - configureNdkBuildRelease.dependsOn(preBuild) - } - - packagingOptions { - pickFirst '**/libhermes.so' - pickFirst '**/libjsc.so' - } ++ def reactAndroidProjectDir = project(':ReactAndroid').projectDir ++ def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) { ++ dependsOn(":ReactAndroid:packageReactNdkLibsForBuck") ++ dependsOn("generateCodegenArtifactsFromSchema") ++ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") ++ into("$buildDir/react-ndk/exported") ++ } ++ ++ afterEvaluate { ++ preBuild.dependsOn(packageReactNdkLibs) ++ configureNdkBuildDebug.dependsOn(preBuild) ++ configureNdkBuildRelease.dependsOn(preBuild) ++ } ++ ++ packagingOptions { ++ pickFirst '**/libhermes.so' ++ pickFirst '**/libjsc.so' ++ } } ``` Finally, we need to create a Makefile inside the `src/main/jni` folder called `Android.mk` with the following content: -```makefile +```makefile title='src/main/jni/Android.mk' THIS_DIR := $(call my-dir) include $(REACT_ANDROID_DIR)/Android-prebuilt.mk @@ -143,7 +140,7 @@ yarn react-native run-android Now is time to actually use the TurboModule. First, we will need to create a `ReactPackageTurboModuleManagerDelegate` subclass, like the following: -```java +```java title='ReactPackageTurboModuleManagerDelegate.java' package com.awesomeproject; import com.facebook.jni.HybridData; @@ -192,7 +189,7 @@ Then, you can provide the class you created to your `ReactNativeHost`. You can l Once you located it, you need to add the `getReactPackageTurboModuleManagerDelegateBuilder` method as from the snippet below: -```java +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = @@ -206,11 +203,11 @@ public class MyApplication extends Application implements ReactApplication { @Override protected String getJSMainModuleName() {/* ... */ } - @NonNull - @Override - protected ReactPackageTurboModuleManagerDelegate.Builder getReactPackageTurboModuleManagerDelegateBuilder() { - return new MyApplicationTurboModuleManagerDelegate.Builder(); - } ++ @NonNull ++ @Override ++ protected ReactPackageTurboModuleManagerDelegate.Builder getReactPackageTurboModuleManagerDelegateBuilder() { ++ return new MyApplicationTurboModuleManagerDelegate.Builder(); ++ } }; } ``` @@ -219,7 +216,7 @@ public class MyApplication extends Application implements ReactApplication { Still on the `ReactNativeHost` , we need to extend the the `getPackages()` method to include the newly created TurboModule. Update the method to include the following: -```java +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = @@ -231,38 +228,37 @@ public class MyApplication extends Application implements ReactApplication { protected List getPackages() { List packages = new PackageList(this).getPackages(); - // Add those lines - packages.add(new TurboReactPackage() { - @Nullable - @Override - public NativeModule getModule(String name, ReactApplicationContext reactContext) { - if (name.equals(NativeAwesomeManager.NAME)) { - return new NativeAwesomeManager(reactContext); - } else { - return null; - } - } - - @Override - public ReactModuleInfoProvider getReactModuleInfoProvider() { - return () -> { - final Map moduleInfos = new HashMap<>(); - moduleInfos.put( - NativeAwesomeManager.NAME, - new ReactModuleInfo( - NativeAwesomeManager.NAME, - "NativeAwesomeManager", - false, // canOverrideExistingModule - false, // needsEagerInit - true, // hasConstants - false, // isCxxModule - true // isTurboModule - ) - ); - return moduleInfos; - }; - } - }); ++ packages.add(new TurboReactPackage() { ++ @Nullable ++ @Override ++ public NativeModule getModule(String name, ReactApplicationContext reactContext) { ++ if (name.equals(NativeAwesomeManager.NAME)) { ++ return new NativeAwesomeManager(reactContext); ++ } else { ++ return null; ++ } ++ } ++ ++ @Override ++ public ReactModuleInfoProvider getReactModuleInfoProvider() { ++ return () -> { ++ final Map moduleInfos = new HashMap<>(); ++ moduleInfos.put( ++ NativeAwesomeManager.NAME, ++ new ReactModuleInfo( ++ NativeAwesomeManager.NAME, ++ "NativeAwesomeManager", ++ false, // canOverrideExistingModule ++ false, // needsEagerInit ++ true, // hasConstants ++ false, // isCxxModule ++ true // isTurboModule ++ ) ++ ); ++ return moduleInfos; ++ }; ++ } ++ }); return packages; } @@ -295,7 +291,7 @@ The content of those files should be the following: Please note that the `kJavaDescriptor` should be adapted to follow the package name you picked for your project. -```cpp +```cpp title='MyApplicationTurboModuleManagerDelegate.h' #include #include @@ -330,7 +326,7 @@ private: #### MyApplicationTurboModuleManagerDelegate.cpp -```cpp +```cpp title='MyApplicationTurboModuleManagerDelegate.cpp' #include "MyApplicationTurboModuleManagerDelegate.h" #include "MyApplicationModuleProvider.h" @@ -362,7 +358,7 @@ std::shared_ptr MyApplicationTurboModuleManagerDelegate::getTurboMo #### MyApplicationModuleProvider.h -```cpp +```cpp title='MyApplicationModuleProvider.h' #pragma once #include @@ -386,7 +382,7 @@ This is the C++ generated file that is created by the codegen. Here you can also specify more than one provider, should you have more than one TurboModule. Specifically in this example we look for a TurboModule from `samplelibrary` (the one we specified) and we fallback to the `rncore` Module Provider (containing all the Core modules). -```cpp +```cpp title='MyApplicationModuleProvider.cpp' #include "MyApplicationModuleProvider.h" #include @@ -410,7 +406,7 @@ std::shared_ptr MyApplicationModuleProvider(const std::string modul #### OnLoad.cpp -```cpp +```cpp title='OnLoad.cpp' #include #include "MyApplicationTurboModuleManagerDelegate.h" @@ -425,12 +421,12 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { Now you can finally enable the `TurboModule `support in your Application. To do so, you need to turn on the `useTurboModule` flag inside your Application `onCreate` method. -```java +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { @Override public void onCreate() { - ReactFeatureFlags.useTurboModules = true; ++ ReactFeatureFlags.useTurboModules = true; //... } ``` diff --git a/docs/new-architecture-app-modules-ios.md b/docs/new-architecture-app-modules-ios.md index 8c3cbac6c97..89ea6242de1 100644 --- a/docs/new-architecture-app-modules-ios.md +++ b/docs/new-architecture-app-modules-ios.md @@ -17,14 +17,14 @@ Make sure your application meets all the [prerequisites](new-architecture-app-in Add the following imports at the top of your bridge delegate (e.g. `AppDelegate.mm`): -```objc +```objc title='AppDelegate.mm' #import #import ``` You will also need to declare that your AppDelegate conforms to the `RCTTurboModuleManagerDelegate` protocol, as well as create an instance variable for our Turbo Module manager: -```objc +```objc title='AppDelegate.mm' @interface AppDelegate () { // ... RCTTurboModuleManager *_turboModuleManager; @@ -103,7 +103,7 @@ Take note of `getModuleInstanceFromClass:` in the following example, as it inclu Next, you will create a `RCTTurboModuleManager` in your bridge delegate’s `jsExecutorFactoryForBridge:` method, and install the JavaScript bindings: -```objc +```objc title='AppDelegate.mm' #pragma mark - RCTCxxBridgeDelegate - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge @@ -159,7 +159,7 @@ RCTEnableTurboModule(YES); #### Example -```objc +```objc title='AppDelegate.mm' @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { diff --git a/docs/new-architecture-app-renderer-android.md b/docs/new-architecture-app-renderer-android.md index 5750b20d1fb..b6999956520 100644 --- a/docs/new-architecture-app-renderer-android.md +++ b/docs/new-architecture-app-renderer-android.md @@ -19,50 +19,49 @@ In order to enable Fabric in your app, you would need to add a `JSIModulePackage Once you located it, you need to add the `getJSIModulePackage` method as from the snippet below: -```java title='MyApplication.java' +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - // Add those lines: - @Nullable - @Override - protected JSIModulePackage getJSIModulePackage() { - return new JSIModulePackage() { - @Override - public List getJSIModules( - final ReactApplicationContext reactApplicationContext, - final JavaScriptContextHolder jsContext) { - final List specs = new ArrayList<>(); - specs.add(new JSIModuleSpec() { - @Override - public JSIModuleType getJSIModuleType() { - return JSIModuleType.UIManager; - } - - @Override - public JSIModuleProvider getJSIModuleProvider() { - final ComponentFactory componentFactory = new ComponentFactory(); - CoreComponentsRegistry.register(componentFactory); - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); - - ViewManagerRegistry viewManagerRegistry = - new ViewManagerRegistry( - reactInstanceManager.getOrCreateViewManagers( - reactApplicationContext)); - - return new FabricJSIModuleProvider( - reactApplicationContext, - componentFactory, - new EmptyReactNativeConfig(), - viewManagerRegistry); - } - }); - return specs; - } - }; - } ++ @Nullable ++ @Override ++ protected JSIModulePackage getJSIModulePackage() { ++ return new JSIModulePackage() { ++ @Override ++ public List getJSIModules( ++ final ReactApplicationContext reactApplicationContext, ++ final JavaScriptContextHolder jsContext) { ++ final List specs = new ArrayList<>(); ++ specs.add(new JSIModuleSpec() { ++ @Override ++ public JSIModuleType getJSIModuleType() { ++ return JSIModuleType.UIManager; ++ } ++ ++ @Override ++ public JSIModuleProvider getJSIModuleProvider() { ++ final ComponentFactory componentFactory = new ComponentFactory(); ++ CoreComponentsRegistry.register(componentFactory); ++ final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); ++ ++ ViewManagerRegistry viewManagerRegistry = ++ new ViewManagerRegistry( ++ reactInstanceManager.getOrCreateViewManagers( ++ reactApplicationContext)); ++ ++ return new FabricJSIModuleProvider( ++ reactApplicationContext, ++ componentFactory, ++ new EmptyReactNativeConfig(), ++ viewManagerRegistry); ++ } ++ }); ++ return specs; ++ } ++ }; ++ } }; } ``` @@ -72,31 +71,31 @@ public class MyApplication extends Application implements ReactApplication { Inside your `Activity` class, you need to make sure you’re calling `setIsFabric` on the `ReactRootView`. If you don’t have a `ReactActivityDelegate` you might need to create one. -```java +```diff title='MainActivity.java' public class MainActivity extends ReactActivity { // Add the Activity Delegate, if you don't have one already. - public static class MainActivityDelegate extends ReactActivityDelegate { - - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - - // Make sure to call setIsFabric(true) on your ReactRootView - reactRootView.setIsFabric(true); - return reactRootView; - } - } ++ public static class MainActivityDelegate extends ReactActivityDelegate { ++ ++ public MainActivityDelegate(ReactActivity activity, String mainComponentName) { ++ super(activity, mainComponentName); ++ } ++ ++ @Override ++ protected ReactRootView createRootView() { ++ ReactRootView reactRootView = new ReactRootView(getContext()); ++ ++ // Make sure to call setIsFabric(true) on your ReactRootView ++ reactRootView.setIsFabric(true); ++ return reactRootView; ++ } ++ } // Make sure to override the `createReactActivityDelegate()` method. - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new MainActivityDelegate(this, getMainComponentName()); - } ++ @Override ++ protected ReactActivityDelegate createReactActivityDelegate() { ++ return new MainActivityDelegate(this, getMainComponentName()); ++ } } ``` @@ -202,7 +201,7 @@ public class MyNativeViewManager extends SimpleViewManager Specifically inside the `ReactNativeHost` , update `getPackages` method to include the following: -```java +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @@ -216,22 +215,22 @@ public class MyApplication extends Application implements ReactApplication { // ... other packages or `TurboReactPackage added` here... // Add those lines. - packages.add(new ReactPackage() { - @NonNull - @Override - public List createNativeModules( - @NonNull ReactApplicationContext reactContext) { - return Collections.emptyList(); - } - - @NonNull - @Override - public List createViewManagers( - @NonNull ReactApplicationContext reactContext) { - // Your ViewManager is returned here. - return Collections.singletonList(new MyNativeViewManager()); - } - }); ++ packages.add(new ReactPackage() { ++ @NonNull ++ @Override ++ public List createNativeModules( ++ @NonNull ReactApplicationContext reactContext) { ++ return Collections.emptyList(); ++ } ++ ++ @NonNull ++ @Override ++ public List createViewManagers( ++ @NonNull ReactApplicationContext reactContext) { ++ // Your ViewManager is returned here. ++ return Collections.singletonList(new MyNativeViewManager()); ++ } ++ }); return packages; } }; @@ -244,7 +243,7 @@ You need to create a new component Registry that will allow you to **register** As you can see, some methods are `native()` which we will implement in C++ in the following paragraph. -```java +```java title='MyComponentsRegistry.java' package com.awesomeproject; import com.facebook.jni.HybridData; @@ -279,7 +278,7 @@ public class MyComponentsRegistry { Finally, let’s edit the `getJSIModulePackage` from the `ReactNativeHost` to also register your Component Registry alongside the Core one: -```java +```diff title='MyApplication.java' public class MyApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @@ -293,17 +292,14 @@ public class MyApplication extends Application implements ReactApplication { final JavaScriptContextHolder jsContext) { final List specs = new ArrayList<>(); specs.add(new JSIModuleSpec() { - // ... @Override public JSIModuleProvider getJSIModuleProvider() { final ComponentFactory componentFactory = new ComponentFactory(); CoreComponentsRegistry.register(componentFactory); - // Add this line just below CoreComponentsRegistry.register - MyComponentsRegistry.register(componentFactory); - - // ... ++ // Add this line just below CoreComponentsRegistry.register ++ MyComponentsRegistry.register(componentFactory); } }); return specs; @@ -434,20 +430,18 @@ void MyComponentsRegistry::registerNatives() { If you followed the TurboModule instructions, you should have a `OnLoad.cpp` file inside the `src/main/jni` folder. There you should add a line to load the `MyComponentsRegistry` class: -```cpp title="OnLoad.cpp" -#include -#include "MyApplicationTurboModuleManagerDelegate.h" -// Add this import -#include "MyComponentsRegistry.h" - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::jni::initialize(vm, [] { - facebook::react::MyApplicationTurboModuleManagerDelegate::registerNatives(); - - // Add this line - facebook::react::MyComponentsRegistry::registerNatives(); - }); -} +```diff title="OnLoad.cpp" + #include + #include "MyApplicationTurboModuleManagerDelegate.h" ++#include "MyComponentsRegistry.h" + + JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { + return facebook::jni::initialize(vm, [] { + facebook::react::MyApplicationTurboModuleManagerDelegate::registerNatives(); + ++ facebook::react::MyComponentsRegistry::registerNatives(); + }); + } ``` You can now verify that everything works correctly by running your android app: diff --git a/docs/new-architecture-library-android.md b/docs/new-architecture-library-android.md index 1efa423e61f..a7e30f27b33 100644 --- a/docs/new-architecture-library-android.md +++ b/docs/new-architecture-library-android.md @@ -17,7 +17,7 @@ Once you have defined the JavaScript specs for your native modules as part of th You can now configure Codegen by specifying the following in the module-level `build.gradle` file: -```groovy +```groovy title='android/app/build.gradle' react { reactRoot = rootProject.file("../node_modules/react-native/") jsRootDir = rootProject.file("../js/") @@ -93,7 +93,7 @@ Update your native module or component to ensure it **extends the abstract class Following the example set forth in the previous section, your library might import `NativeAwesomeManagerSpec`, implement the relevant native interface and the necessary methods for it: -```java +```java title='NativeAwesomeManager.java' import androidx.annotation.NonNull; import com.example.samplelibrary.NativeAwesomeManagerSpec; From 558df3321df31f0ba69ad3d8fe988fc5a62b5501 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 1 Mar 2022 18:17:37 +0000 Subject: [PATCH 2/2] Fix whitespace --- docs/new-architecture-app-renderer-android.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/new-architecture-app-renderer-android.md b/docs/new-architecture-app-renderer-android.md index b6999956520..bee9ed0c2f3 100644 --- a/docs/new-architecture-app-renderer-android.md +++ b/docs/new-architecture-app-renderer-android.md @@ -434,11 +434,11 @@ If you followed the TurboModule instructions, you should have a `OnLoad.cpp` fil #include #include "MyApplicationTurboModuleManagerDelegate.h" +#include "MyComponentsRegistry.h" - + JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { return facebook::jni::initialize(vm, [] { facebook::react::MyApplicationTurboModuleManagerDelegate::registerNatives(); - + + facebook::react::MyComponentsRegistry::registerNatives(); }); }