Getting Started with React Native

setting up environment

ยท

3 min read

Getting Started with React Native

A little disclosure to the widely popular question i.e., Why build mobile apps with react native?

  1. React Native is a cross-platform, single codebase stack for both native iOS and Android apps.
  2. Uses React Javascript.
  3. 100% access to native APIs via Javascript and reuse of packages from NPM.
  4. Backed by Facebook. isn't it enough? Hey, It's most easy to set up and start development quickly.

    I'll be providing 3 major ways in which you can complete your setup and begin your development journey in react native.

Snack

If you'd like to try out React Native directly in your web browser before installing any tools, you can try out Snack. It's the easiest way to work on react native with low system configurations and requirements. This platform is highly beneficial for learning and teaching purposes as well. And another advantage that you can build and host small react native projects on the Snack. It is much easier to share your project and get quick feedback from mentors. It's like Codepen for React Native.

Expo Cli

As you are getting started with React native, it is the most friendly choice, easy to begin with, and above all, supports live rendering of your code on your physical device. Seeing your code working on your physical device is quite a feeling of achievement. As I started development, I followed a lot of tutorials that were deprecated till that time, so I had to struggle a lot. And expo CLI has helped me set up my learning journey of react-native. To begin with, Assuming that you have NODE installed, use your command line to install expo CLI

npm install -g expo-cli

Then create a new React Native project using

expo init <Project Name>
cd <Project Name> 
expo start

And a QR code is rendered in your command line that can be scanned by EXPO GO client app. It will load the app on your physical device and perform live rendering with minimal loading delays. Building mobile apps and rendering your current development on physical device is a satisfying experience.

React Native CLI

React Native CLI is a second-level method to begin your react native journey as it embarks upon high-level requirements like high-performance system specifications and needs you to install an android or iOS simulator. You will need Node, the React Native command line interface, Python, a JDK, and a simulator. It is very effective to build highly complex apps and more use case configurations. Either way, you can switch to React Native CLI even if you started using EXPO CLI

I highly suggest you following React native docs, even when you are following any course, tutorial, blog, or any book. We see many packages and modules and approaches get either optimized or deprecated by the time we start our journey. So, to avoid learning deprecated stuff, do look to the docs.

Did you find this article valuable?

Support Agrit Tiwari by becoming a sponsor. Any amount is appreciated!

ย