React Native Newbie Questions Answered!

Image for post
Image for post

You want to develop your mobile app, and want to use a cross-platform mobile framework. You have heard about React Native, but not sure if it is the right choice for you. In this post, I am going to try to answer the frequently asked newbie React Native questions. I have been developing React Native apps for the last few years and have across several questions from the community. This is a collection of questions and answers that will help you decide if React Native is right for you!

1. What programming language does React Native use?

Answer: JavaScript

React Native is a library that uses JavaScript to develop native mobile apps. It also uses the popular web library React. Hence the name “React Native”

React Native = JavaScript + React

2. Should I learn native iOS/Android coding?

Image for post
Image for post

Answer: No

This short answer to this question is No. The beauty of React Native is that you can leverage JavaScript to build native mobile apps. All the native coding is under the hood, and you don’t need to learn native iOS or Android coding to be a React Native.

Although, I must say, having a little native experience doesn’t hurt! It can come in handy sometimes, although it is not required. I became a React Native developer with zero native coding experience.

There are two ways to build React Native apps. You can either use expo, or use the React Native CLI. If you are going to use expo, you absolutely don’t need to know any native coding at all.

3. Can I use the same code across iOS and Android?

Answer: Yes

You can use React Native to build cross-platform apps for both iOS and Android. You would maintain the same codebase for both. From all the projects that I have worked on, I have seen about 95% code re-use between the platforms. The 5% comes from subtle changes that are platform specific, mostly related the UI.

This a huge benefit of React Native, since you don’t need to manage multiple code bases and teams across platforms.

4. Is React Native different than React?

Image for post
Image for post

Answer: React Native uses React

React Native essentially uses React to build mobile applications. React is a frontend JavaScript library that is used to build user interfaces. React Native is a framework that uses React to build mobile applications.

A simple component in React:

import React from 'react';const Cat = () => {
return (
<div>
<p>Hello, I am your cat!</p>
</div>
);
}
export default Cat;

A simple component in React Native:

import React from 'react';
import { Text, View } from 'react-native';
const Cat = () => {
return (
<View>
<Text>Hello, I am your cat!</Text>
</View>
);
}
export default Cat;

So in a nutshell, React Native uses the exact same concepts as React, and follows the component based architecture. You will learn React first before you dive into React Native. The difference is in the syntax and how it renders. React Native code renders ultimately into native iOS or Android code.

5. Is React Native fast changing?

Image for post
Image for post

Answer: Yes

React Native has been used in production applications for the past four years. Yes, a lot has changed in the last four years, and today React Native is at version 0.63.

React Native is open-source and primarily managed by a team at Facebook. Currently, they are following close to a monthly release train. React Native releases can be found here.

Although there are frequent releases, not all new versions of React Native will result in breaking changes. This is just the nature of any open-source modern framework.

Keep in mind that it is good to keep up with the releases, by upgrading your projects every few months to the latest stable React Native version.

6. Can I reuse React Native code for web?

Answer: Yes, most of it!

One big perk of using React Native for your mobile apps, is that you can reuse plenty of the code for the web version. I had worked on a React Native mobile app, that needed a web version. I was able able to reuse all the business logic for which I had used Redux, and library functions etc.. The only differences come in translating the React Native component to a React component. And you will also have layout and other UI differences between web and mobile.

There is a well received library called React Native Web, that can run React Native components and APIs on the web using React DOM. You can leverage this as well.

7. Is there a fast way to deploy code changes?

Answer: Yes! Use Code push

A dreadful part of mobile app development, is the deployment to the various stores. Apple Store for iOS and Google Play for Android devices. Although, you will have to deploy your code changes to the app stores, you don’t have to always release via the app store.

React Native provides a super easy and fast way to deploy changes using code push. If your code changes are all on the JavaScript layer, without any native code changes, you can instantly deploy your changes using code push. This is sets React Native apart from some other counter parts like Flutter, that does not support code push. The CodePush plugin helps get product improvements in front of your end users instantly.

This saves developers and QA, plenty of time, which we would otherwise spend on waiting for the app store to approve the app changes.

8. Should I use Expo or not?

Answer: Depends on your use-case

There are two ways to build React Native apps. One using Expo, and the other just using plain React Native, without Expo. I have recently written an article that elaborates when to use Expo, and when it is better to use the React Native CLI.

Read: Expo or Not — Building React Native Apps

Overall, Expo is great, and I recommend anyone starting with React Native, to build apps using Expo, unless they really have reason not to.

Help Me Get Started!

The React Native community has grown over the years and is welcoming. To get started with your learning, checkout the official React Native links below:

https://reactnative.dev/

Official React Native Repo

React Native Community Repo

Resources from me:

I co-host the React Native Radio podcast with my friends at Infinite Red where we talk all things React Native. You can listen to the episodes below:

Checkout my course React Native: The Big Picture on Pluralsight to get a big picture overview of React Native.

You can also watch my talk on egghead.io below:

I hope you enjoyed this article. See you again with more articles. If you liked this post, don’t forget to share it with your network. You can follow me on twitter @AdhithiRavi for more updates or if you have any questions.

This article was originally published in https://programmingwithmosh.com/

Written by

Software Consultant, Author, Speaker, React Native|React|GraphQL Dev & Indian Classical Musician http://adhithiravichandran.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store