React Native
JavaScript
Mobile Development
Beginner Guide
Cross-Platform Apps
Programming
Software Development

How to Get Started with React Native: A Beginners Guide

Deepak Tewatia
September 5, 2025
3 min read

Introduction

React Native is a great way to build apps for phones using JavaScript. It allows you to create apps that work on both iOS and Android from a single codebase. If you are new to programming or mobile development, this guide will help you take the first steps.

Setting Up Your Computer

Before you can start building apps, you need to set up your computer. First, you need to install Node.js. Node.js lets you run JavaScript on your computer. Here are simple steps to install it:

  1. Go to the Node.js website.
  2. Download the version recommended for most users.
  3. Run the installer and follow the instructions.

After installing Node.js, it’s good to have a code editor. A popular choice is Visual Studio Code. You can download and install it from their website.

Creating Your First React Native Project

Now that your computer is ready, you can create a new React Native project. Here’s how:

npx react-native init MyFirstApp

Replace MyFirstApp with whatever name you want for your project. The npx command will download and run the React Native CLI tool without installing it globally.

To run your app, navigate to your project folder:

cd MyFirstApp

Then, you can start the app on an Android simulator or an iOS simulator. For Android, you can use:

npx react-native run-android

Or for iOS, use:

npx react-native run-ios

Make sure you have the necessary tools installed to run the simulators. For Android, you will need Android Studio, and for iOS, you will need Xcode.

Understanding Components

In React Native, everything is built using components. A component is like a building block. You can use it to create parts of your app. Let’s create a simple component:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

const HelloWorld = () => {
  return (
    <View style={styles.container}>
      <Text>Hello, World!</Text>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default HelloWorld;

This code defines a component that shows “Hello, World!” in the center of the screen. You’ll need to update your main app file to use this component. You could replace the default code in App.js with your new component.

Adding Styles

Styling in React Native is similar to CSS, but you use JavaScript objects instead. Here’s a simple way to add styles:

  • Use the StyleSheet.create method to create styles.
  • Apply styles to components using the style prop.

Here’s an example of how to style your HelloWorld component:

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#f0f0f0',
  },
  text: {
    fontSize: 20,
    color: '#333',
  },
});

By updating the component to use the new styles, you can change how things look in your app easily.

Conclusion

Getting started with React Native is not hard. With Node.js set up and a simple command, you can create your first app. Understanding components and styles will help you make your app look good and function well. Remember, practice is key. Take your time, explore, and soon you will be building fun apps!

Comments

Y
You
Commenting
0/2000
Loading comments…