Skip to content

Best practice to integrate existing app with React-Native #995

@ssssssssssss

Description

@ssssssssssss

Hi There,

Thanks for your great work.
We have a bunch of legacy native code and want to have react-native get involved in the next version. As RN is not so feature complete to us, we'd like to experiment it as a component. Here are some thoughts about the future architecture based on our limited knowledge of RN, please comment.

  1. We'd like to create a minimal component in JS land and use it as RCTRootView at App start.
  2. As the App is native and RN hybrid, we'd like to reuse the *bridge created at first step, so it won't load JS files again.
  3. registerComponent for different kind of views in JS land, so we can have multiple entries for native code which manage the lifecycle of RN's RootView(s).
  4. Passing data back and forth between native code and RN. We experimented DeviceEventEmitter, but RN code runs in async mode, how can we guarantee the events send by native code will be listened in JS land? And we also tried AppParams.initialProps, but don't know how to get the value in JS land?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions