Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React Native fundamentals for brownfield iOS apps

React Native fundamentals for brownfield iOS apps

(Presented at App.js Conf: April 4, 2019)

In this talk, Karan will share his learnings from working on the React Native infrastructure at Skyscanner. These are concepts, issues and roadblocks that a developer would encounter in their journey of integrating React Native in a brownfield app. Knowing these ahead of time would help folks take the right decisions when building their own React Native infrastructure.

Karan Thakkar

April 04, 2019
Tweet

More Decks by Karan Thakkar

Other Decks in Technology

Transcript

  1. What are we going to cover? Showing a React Native

    screen Navigation Reusing React Native components in Native
  2. Showing a React Native screen vc.view = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation

    moduleName:moduleName initialProperties:initialProperties launchOptions:nil];
  3. View Controller UIViewController *vc = [UIViewController new]; Showing a React

    Native screen vc.view = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:moduleName initialProperties:initialProperties launchOptions:nil]; Initialising the bridge (RCTBridge) Creating the React Native View
 (RCTRootView) Just in time Ahead of time
  4. Initialising the bridge Creating the React Native View [[RCTRootView alloc]

    initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
  5. Figure out how navigation works in your app Create a

    bridge module that expose methods So how do you solve them? - Opening a screen - Closing a screen
  6. Reusing React Native components in Native RCTRootView *rootView = [[RCTRootView

    alloc] initWithBridge:bridge moduleName:@“Widget” initialProperties:nil]; [vc.view addSubview:rootView];