Integrating React Native into exsting app -


integration existing apps shows

rctrootview *rootview =   [[rctrootview alloc] initwithbundleurl: jscodelocation                               modulename: @"rnhighscores"                        initialproperties: nil                            launchoptions: nil]; uiviewcontroller *vc = [[uiviewcontroller alloc] init]; vc.view = rootview; [self presentviewcontroller:vc animated:yes completion:nil]; 

that construct rn view presenting view controller, not in presented view controller.

whereas android, doc shows way create reactrootview presented(created) activity.

public class myreactactivity extends activity implements defaulthardwarebackbtnhandler {     private reactrootview mreactrootview;     private reactinstancemanager mreactinstancemanager;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);          mreactrootview = new reactrootview(this);         mreactinstancemanager = reactinstancemanager.builder()                 .setapplication(getapplication())                 .setbundleassetname("index.android.bundle")                 .setjsmainmodulename("index.android")                 .addpackage(new mainreactpackage())                 .setusedevelopersupport(buildconfig.debug)                 .setinitiallifecyclestate(lifecyclestate.resumed)                 .build();         mreactrootview.startreactapplication(mreactinstancemanager, "helloworld", null);          setcontentview(mreactrootview);     }  } 

would possible ios app similar above android code do? create custom view controller , instantiate rctrootview in viewdidload.
there drawback doing that?

yes work. although don't know if there's drawback.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -