AV's Blog

Getting Started with React Native

October 12, 2018


I finally tried to get started on learning React Native. Having Node.js already installed in my computer, it was not a problem. I just followed the “Getting Started” instructions in the official docs for React Native. In this case, I have a mid-2015 MacBook Pro and an old iPhone I have not been able to upgrade since getting it in 2013.

After globally installing expo-cli using npm, starting a project was easy by calling expo init projectName with projectName being the name of my project. This creates a folder with the name projectName, which contains the starter for creating the app. Calling npm start runs the app in development mode.

The fun started when I got the app running on my iPhone, although at first, I thought I needed to use a new phone to run it. It still worked. But I had to download the Expo client app on my phone first. After that, all I needed to do was use the camera to get the phone to go see a QR code to open the project on the phone.

On my IDE, I simply edited the file named App.js to modify what’s being rendered on the project. It was fun seeing the changes on the phone after saving something/making changes. It’s a little bit slower, however. I played around a little bit with what I can do in React Native. It’s a good thing I kind of know how to use React. Now, it’s just a matter of creating a real project.

Eventually, I learned about the iOS Simulator on XCode, which I didn’t have (I only have Command Line Tools installed). I then downloaded it from the App Store and installing it took about an hour and half! After installing it and agreeing to the license agreement, I was able to run the iOS simulator. The iOS device that appeared by default in my case was the iPhone Xs Max, which now makes me want to get one! (Maybe someday.)

Anyways, I had fun trying out React Native. Can’t wait to get started with making an app with it!

Update, October 14:

I found out about Bluestacks, an Android emulator, which I downloaded. This allows me to see my app in both iOS and Android. Installation on my Mac was straightforward. Hoping it will be smooth-sailing from here on.