How to do it...

  1. Let's begin in the native layer. Open the EmbeddedApp native app in Xcode via the .xcworkspace file. We'll first add imports to ViewController.m:
#import "ViewController.h"#import "EmbeddedViewController.h"#import <React/RCTRootView.h>#import <React/RCTBridge.h>#import <React/RCTEventDispatcher.h>
  1. As we did in the last recipe, we need to add a reference to the React Native bridge via the ViewController interface, providing a bridge between the native controller and the React Native code:
@interface ViewController () <RCTBridgeDelegate> {    EmbeddedViewController *embeddedViewController;    RCTBridge *_bridge;    BOOL isRNRunning;}
  1. We will also need a @property reference of userNameField that we will use in a later step to wire ...

Get React Native Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.