diff --git a/docs/embedded-app-ios.html b/docs/embedded-app-ios.html index 284645fd6ce..696a357619f 100644 --- a/docs/embedded-app-ios.html +++ b/docs/embedded-app-ios.html @@ -44,7 +44,6 @@ React.AppRegistry// curl http://localhost:8081/index.ios.bundle -o main.jsbundle RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName: @"SimpleApp" - initialProperties:nil launchOptions:nil];
Then add it as a subview of the ReactView.
In root directory, we need to start React Native development server.
This command will start up a React Native development server within our CocoaPods dependency to build our bundled script. The --root option indicates the root of your React Native apps – this will be our ReactComponents directory containing the single index.ios.js file. This running server will package up the index.ios.bundle file accessible via http://localhost:8081/index.ios.bundle.
Now compile and run your app. You shall now see your React Native app running inside of the ReactView.

Live reload works from the simulator, too! You’ve got a simple React component totally encapsulated behind an Objective-C UIView subclass.
So under the hood, when RCTRootView is initialized, it will try to download, parse and run the bundle file from React Native development server. This means all you need to do is to implement your own container view or view controller for the RCTRootView – the RCTRootView ingests your bundled JS and renders your React components. Bravo!
You can checkout full source code of a sample application here.