React Native Brownfield provides first-class support for Objective-C.
You can import the object from:
sharedA singleton that keeps an instance of ReactNativeBrownfield object.
| Property | Type | Default | Description |
|---|---|---|---|
entryFile | NSString | index | Path to JavaScript root. |
fallbackResource | NSString | nil | Path to bundle fallback resource. |
bundlePath | NSString | main.jsbundle | Path to bundle fallback resource. |
bundle | NSBundle | Bundle.main | Bundle instance to lookup the JavaScript bundle resource. |
startReactNativeStarts React Native, produces an instance of React Native. You can use it to initialize React Native in your app.
| Param | Required | Type | Description |
|---|---|---|---|
onBundleLoaded | No | void(^)(void) | Callback invoked after JS bundle is fully loaded. |
launchOptions | No | NSDictionary | Launch options, typically passed from AppDelegate. |
Examples:
viewCreates a React Native view for the specified module name.
| Param | Required | Type | Description |
|---|---|---|---|
moduleName | Yes | NSString | Name of React Native component registered to AppRegistry. |
initialProps | No | NSDictionary | Initial properties to be passed to React Native component. |
launchOptions | No | NSDictionary | Launch options, typically passed from AppDelegate. |
Examples:
ReactNativeViewControllerA view controller that's rendering React Native view within its bounds. It automatically uses an instance of a factory created in startReactNative method. It works well with exposed JavaScript module. It's the simplest way to embed React Native into your navigation stack.
You can import it from:
[ReactNativeViewController initWithModuleName:moduleName andInitialProperties:initialProps]| Param | Required | Type | Description |
|---|---|---|---|
moduleName | Yes | NSString | Name of React Native component registered to AppRegistry. |
initialProperties | No | NSDictionary | Initial properties to be passed to React Native component. |
Examples: