Skip to content

Commit 0d55c6d

Browse files
committed
docs: update
1 parent 86c077e commit 0d55c6d

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

docs/docs/docs/getting-started/expo.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,19 @@ This should only take a few minutes.
111111
- Follow the step for adding the frameworks to your iOS App - [here](/docs/getting-started/ios#6-add-the-framework-to-your-ios-app)
112112
<hr/>
113113

114-
1. Call the `ReactNativeHostManager.shared.initialize()` from your Application Entry point:
114+
1. Call the following functions from your Application Entry point:
115115

116116
```swift
117117
@main
118118
struct IosApp: App {
119119
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
120120

121121
init() {
122-
ReactNativeHostManager.shared.initialize()
122+
ReactNativeBrownfield.shared.bundle = ReactNativeBundle
123+
ReactNativeBrownfield.shared.startReactNative {
124+
print("React Native has been loaded")
125+
}
126+
ReactNativeBrownfield.shared.ensureExpoModulesProvider()
123127
}
124128

125129
var body: some Scene {
@@ -140,19 +144,19 @@ class AppDelegate: NSObject, UIApplicationDelegate {
140144
_ application: UIApplication,
141145
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
142146
) -> Bool {
143-
return ReactNativeHostManager.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
147+
return ReactNativeBrownfield.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
144148
}
145149
}
146150
```
147151

148-
3. Use the `ReactNativeHostManager.loadView` to present the UI
152+
3. Use the `ReactNativeView` or `ReactNativeViewController` to present the UI
149153

150-
```
151-
let RNView = ReactNativeHostManager.shared.loadView(moduleName: "ExpoRNApp", initialProps: nil, launchOptions: nil)
154+
```swift
155+
ReactNativeView(moduleName: "ExpoRNApp")
156+
.background(Color(UIColor.systemBackground))
152157
```
153158

154-
> This returns a UIView, so if you're using SwiftUI, you will have to wrap this in UIViewRrepresentable .
155-
You can see the demo integration in [Apple App](https://github.com/callstack/react-native-brownfield/blob/main/apps/AppleApp/Brownfield%20Apple%20App/BrownfieldAppleApp.swift) as well
159+
> You can also use `ReactNativeBrownfield.shared.view(moduleName, initialProps)` which returns a UIView.
156160
157161
4. Build and install the iOS application 🚀
158162

0 commit comments

Comments
 (0)