

Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.īefore you integrate React Native into your application, you will want to decide what parts of the React Native framework you would like to integrate. Here is what the main menu of the native application looks like without React Native. Adding React Native to your app #Īssume the app for integration is a 2048 game.
#REACT NATIVE GAME MANUAL#
It is technically possible not to use CocoaPods, but that would require manual library and linker additions that would overly complicate this process. Go to the root directory for your project and create a new package.json file with the following contents:

To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing iOS project to a /ios subfolder.
#REACT NATIVE GAME ANDROID#
If you are using Android Studio, use Alt + Enter to add all missing imports in your MyReactActivity class. Perform a “Sync Project files with Gradle” operation.

If you are using a starter kit for React Native, replace the "HelloWorld" string with the one in your index.js file (it’s the first argument to the AppRegistry.registerComponent() method). In our sample here, we will add a component within a styled : In our case, we will put everything in index.js. It can be a small file that requires other file that are part of your React Native component or application, or it can contain all the code that is needed for it. Index.js is the starting point for React Native applications, and it is always required. Create a index.js file #įirst, create an empty index.js file in the root of your React Native project. The first bit of code we will write is the actual React Native code for the new "High Score" screen that will be integrated into our application. Now we will actually modify the native Android application to integrate React Native. To learn more about Network Security Config and the cleartext traffic policy see this link.
