Skip to content

Commit 96d0a4f

Browse files
RonRadtkeRon Radtke
andauthored
updates all TurboReactPackage to BaseReactPackage (facebook#4374)
* updates all TurboReactPackage to BaseReactPackage * Removes package-lock.json This reverts commit 08fe650. --------- Co-authored-by: Ron Radtke <[email protected]>
1 parent 8324b5e commit 96d0a4f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/fabric-native-components-android.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ This is the code for the `ReactWebViewPackage`:
351351
```java title="Demo/android/src/main/java/com/webview/ReactWebViewPackage.java"
352352
package com.webview;
353353

354-
import com.facebook.react.TurboReactPackage;
354+
import com.facebook.react.BaseReactPackage;
355355
import com.facebook.react.bridge.NativeModule;
356356
import com.facebook.react.bridge.ReactApplicationContext;
357357
import com.facebook.react.module.model.ReactModuleInfo;
@@ -363,7 +363,7 @@ import java.util.HashMap;
363363
import java.util.List;
364364
import java.util.Map;
365365

366-
public class ReactWebViewPackage extends TurboReactPackage {
366+
public class ReactWebViewPackage extends BaseReactPackage {
367367
@Override
368368
public List<ViewManager<?, ?>> createViewManagers(ReactApplicationContext reactContext) {
369369
return Collections.singletonList(new ReactWebViewManager(reactContext));
@@ -404,14 +404,14 @@ public class ReactWebViewPackage extends TurboReactPackage {
404404
```kotlin title="Demo/android/src/main/java/com/webview/ReactWebView.kt"
405405
package com.webview
406406

407-
import com.facebook.react.TurboReactPackage
407+
import com.facebook.react.BaseReactPackage
408408
import com.facebook.react.bridge.NativeModule
409409
import com.facebook.react.bridge.ReactApplicationContext
410410
import com.facebook.react.module.model.ReactModuleInfo
411411
import com.facebook.react.module.model.ReactModuleInfoProvider
412412
import com.facebook.react.uimanager.ViewManager
413413

414-
class ReactWebViewPackage : TurboReactPackage() {
414+
class ReactWebViewPackage : BaseReactPackage() {
415415
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
416416
return listOf(ReactWebViewManager(reactContext))
417417
}
@@ -440,7 +440,7 @@ class ReactWebViewPackage : TurboReactPackage() {
440440
</TabItem>
441441
</Tabs>
442442

443-
The `ReactWebViewPackage` extends the `TurboReactPackage` and implements all the methods required to properly register our component.
443+
The `ReactWebViewPackage` extends the `BaseReactPackage` and implements all the methods required to properly register our component.
444444

445445
- the `createViewManagers` method is the factory method that creates the `ViewManager` that manage the custom views.
446446
- the `getModule` method returns the proper ViewManager depending on the View that React Native needs to render.

docs/turbo-native-modules-android.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ class NativeLocalStorageModule(reactContext: ReactApplicationContext) : NativeLo
107107
</TabItem>
108108
</Tabs>
109109

110-
Next we need to create `NativeLocalStoragePackage`. It provides an object to register our Module in the React Native runtime, by wrapping it as a Turbo Native Package:
110+
Next we need to create `NativeLocalStoragePackage`. It provides an object to register our Module in the React Native runtime, by wrapping it as a Base Native Package:
111111

112112
<Tabs groupId="android-language" queryString defaultValue={constants.defaultAndroidLanguage} values={constants.androidLanguages}>
113113
<TabItem value="java">
114114

115115
```java title="android/app/src/main/java/com/nativelocalstorage/NativeLocalStoragePackage.java"
116116
package com.nativelocalstorage;
117117

118-
import com.facebook.react.TurboReactPackage;
118+
import com.facebook.react.BaseReactPackage;
119119
import com.facebook.react.bridge.NativeModule;
120120
import com.facebook.react.bridge.ReactApplicationContext;
121121
import com.facebook.react.module.model.ReactModuleInfo;
@@ -124,7 +124,7 @@ import com.facebook.react.module.model.ReactModuleInfoProvider;
124124
import java.util.HashMap;
125125
import java.util.Map;
126126

127-
public class NativeLocalStoragePackage extends TurboReactPackage {
127+
public class NativeLocalStoragePackage extends BaseReactPackage {
128128

129129
@Override
130130
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
@@ -162,13 +162,13 @@ public class NativeLocalStoragePackage extends TurboReactPackage {
162162
```kotlin title="android/app/src/main/java/com/nativelocalstorage/NativeLocalStoragePackage.kt"
163163
package com.nativelocalstorage
164164

165-
import com.facebook.react.TurboReactPackage
165+
import com.facebook.react.BaseReactPackage
166166
import com.facebook.react.bridge.NativeModule
167167
import com.facebook.react.bridge.ReactApplicationContext
168168
import com.facebook.react.module.model.ReactModuleInfo
169169
import com.facebook.react.module.model.ReactModuleInfoProvider
170170

171-
class NativeLocalStoragePackage : TurboReactPackage() {
171+
class NativeLocalStoragePackage : BaseReactPackage() {
172172

173173
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? =
174174
if (name == NativeLocalStorageModule.NAME) {
@@ -200,7 +200,7 @@ Finally, we need to tell the React Native in our main application how to find th
200200
In this case, you add it to be returned by the [getPackages](https://github.com/facebook/react-native/blob/8d8b8c343e62115a5509e1aed62047053c2f6e39/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java#L233) method.
201201

202202
:::info
203-
Later you’ll learn how to distribute your Turbo Native Modules as [npm packages](the-new-architecture/create-module-library.md#publish-the-library-on-npm), which our build tooling will autolink for you.
203+
Later you’ll learn how to distribute your Native Modules as [npm packages](the-new-architecture/create-module-library.md#publish-the-library-on-npm), which our build tooling will autolink for you.
204204
:::
205205

206206
<Tabs groupId="android-language" queryString defaultValue={constants.defaultAndroidLanguage} values={constants.androidLanguages}>

0 commit comments

Comments
 (0)