2

I've been trying to investigate a question for a while. I found a couple of articles:

https://facebook.github.io/react-native/docs/embedded-app-ios.html#content https://facebook.github.io/react-native/docs/embedded-app-android.html#content

They say that you can include your React Native code in a native application. Did I understand it right? If so, there are still many questions:

  • will it work offline?
  • does React provide enough capabilities to communicate with React-powered components from native code?
  • how much does it cost (in terms of RAM and storage) to include React Native into existing app?

In short, does this idea — to write some library or UI component using React Native and to allow developers include it in their native apps via suggested mechanisms — seem reasonable or nobody would do that?

1 Answer 1

1

Yes, it will work offline.

React Native does not provide any method for you to communicate with native code out of the box. You will need to build a React Native plugin that calls specific Objective-C or Java methods you wish to invoke.

From a very simple app I am seeing around ~50MB in memory usage, but this will vary wildly depending on what your project contains. React Native is simply creating native platform-specific views, so the more complex your project, the larger the memory usage. React Native is relatively light and in the single-digits of MB size, but again, this will vary greatly.

Overall, the resource intensity will likely be far greater using React Native than coding something natively, and will be far more difficult to interact with from native code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.