How it works...
To accomplish rendering React Native inside of our Android application, we had to perform a few steps. First, we had to define an Application class that implements the ReactApplication interface. Then, we had to create a Fragment that would be responsible for instantiating and rendering the ReactRootView. With a fragment, we are able to render the React Native view in our MainActivity. In this recipe, we added the fragment to our fragment container view. This essentially replaces all of the application content with the React Native application.
We covered a lot of integration code in this recipe. For a more in-depth look at how each of these pieces work, you can read the official documentation at https://facebook.github.io/react-native/docs/integration-with-existing-apps.html ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access