Skip to content

Commit 6a63e4e

Browse files
authored
[RN][Doc] Update brownfield to match the new Podfile (facebook#4562)
1 parent 47c0e7e commit 6a63e4e

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/_integration-with-existing-apps-ios.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ curl -O https://raw.githubusercontent.com/react-native-community/template/refs/h
115115
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.78-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile).
116116

117117
:::note
118-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
119-
120-
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L26-L29).
118+
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17).
121119
:::
122120

123121
Now, we need to run a couple of extra commands to install the Ruby gems and the Pods.
@@ -258,6 +256,8 @@ Now open the `ReactViewController.m` file and apply the following changes
258256
+#import <React/RCTBundleURLProvider.h>
259257
+#import <RCTReactNativeFactory.h>
260258
+#import <RCTDefaultReactNativeFactoryDelegate.h>
259+
+#import <RCTAppDependencyProvider.h>
260+
261261

262262
@interface ReactViewController ()
263263

@@ -275,7 +275,8 @@ Now open the `ReactViewController.m` file and apply the following changes
275275
- (void)viewDidLoad {
276276
[super viewDidLoad];
277277
// Do any additional setup after loading the view.
278-
+ _factoryDelegate = [ReactNativeDelegate new];
278+
+ _factoryDelegate = [ReactNativeFactoryDelegate new];
279+
+ _factoryDelegate.dependencyProvider = [RCTAppDependencyProvider new];
279280
+ _factory = [[RCTReactNativeFactory alloc] initWithDelegate:_factoryDelegate];
280281
+ self.view = [_factory.rootViewFactory viewWithModuleName:@"HelloWorld"];
281282
}
@@ -311,6 +312,7 @@ Now open the `ReactViewController.swift` file and apply the following changes
311312
import UIKit
312313
+import React
313314
+import React_RCTAppDelegate
315+
+import ReactAppDependencyProvider
314316

315317
class ReactViewController: UIViewController {
316318
+ var reactNativeFactory: RCTReactNativeFactory?
@@ -319,6 +321,7 @@ class ReactViewController: UIViewController {
319321
override func viewDidLoad() {
320322
super.viewDidLoad()
321323
+ reactNativeFactoryDelegate = ReactNativeDelegate()
324+
+ reactNativeFactoryDelegate!.dependencyProvider = RCTAppDependencyProvider()
322325
+ reactNativeFactory = RCTReactNativeFactory(delegate: reactNativeFactoryDelegate!)
323326
+ view = reactNativeFactory!.rootViewFactory.view(withModuleName: "HelloWorld")
324327

website/versioned_docs/version-0.78/_integration-with-existing-apps-ios.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ curl -O https://raw.githubusercontent.com/react-native-community/template/refs/h
115115
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.78-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile).
116116

117117
:::note
118-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
119-
120-
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L26-L29).
118+
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17).
121119
:::
122120

123121
Now, we need to run a couple of extra commands to install the Ruby gems and the Pods.
@@ -258,6 +256,7 @@ Now open the `ReactViewController.m` file and apply the following changes
258256
+#import <React/RCTBundleURLProvider.h>
259257
+#import <RCTReactNativeFactory.h>
260258
+#import <RCTDefaultReactNativeFactoryDelegate.h>
259+
+#import <RCTAppDependencyProvider.h>
261260

262261
@interface ReactViewController ()
263262

@@ -275,7 +274,8 @@ Now open the `ReactViewController.m` file and apply the following changes
275274
- (void)viewDidLoad {
276275
[super viewDidLoad];
277276
// Do any additional setup after loading the view.
278-
+ _factoryDelegate = [ReactNativeDelegate new];
277+
+ _factoryDelegate = [ReactNativeFactoryDelegate new];
278+
+ _factoryDelegate.dependencyProvider = [RCTAppDependencyProvider new];
279279
+ _factory = [[RCTReactNativeFactory alloc] initWithDelegate:_factoryDelegate];
280280
+ self.view = [_factory.rootViewFactory viewWithModuleName:@"HelloWorld"];
281281
}

0 commit comments

Comments
 (0)