Paramclasses Academy - Blog

Tutorials Details

Post 1 of 39
→

How to setup React Native : Build Your First Mobile App ?

How to setup React Native : Build Your First Mobile App ?

November 5, 2026

1. Introduction

Mobile applications have become an essential part of our daily lives. From social media and online shopping to banking and education, mobile apps are used everywhere.

Developing mobile applications traditionally requires different programming languages and technologies for different platforms. Android applications commonly use Java or Kotlin, while iOS applications use Swift or Objective-C.

React Native provides an alternative approach. It allows developers to build mobile applications for both Android and iOS using JavaScript and React.

In this tutorial, you will learn the fundamentals of React Native, understand how it works, explore its basic components, and create your first mobile application step by step.

By the end of this tutorial, you will have a basic understanding of React Native development and the structure of a simple mobile application.

2. What Is React Native?

React Native is an open-source mobile application development framework created by Meta.

It allows developers to build native mobile applications using JavaScript and React.

Instead of writing completely separate applications for Android and iOS, developers can share a significant portion of their application code across both platforms.

React Native provides built-in components that correspond to native user interface elements.

For example:

  • View is used to create container layouts.

  • Text is used to display text.

  • Image is used to display images.

  • TextInput is used to accept user input.

  • ScrollView is used to create scrollable content.

  • Pressable is used to handle user interactions.

React Native helps developers build mobile applications with reusable components and a structured development approach.

3. Features of React Native

React Native provides several features that make mobile application development easier.

3.1 Cross-Platform Development

React Native allows developers to create applications for Android and iOS using a shared codebase.

This reduces the need to develop two completely separate applications.

3.2 Component-Based Architecture

React Native applications are built using reusable components.

Each component represents a specific part of the user interface.

For example, a login screen can contain separate components for:

  • Logo

  • Email input

  • Password input

  • Login button

Reusable components make applications easier to maintain and organize.

3.3 JavaScript and React

React Native uses JavaScript and React concepts.

Developers familiar with JavaScript, JSX, components, props, and state can apply these concepts to mobile application development.

3.4 Fast Refresh

Fast Refresh helps developers see many code changes in the running application without manually rebuilding the entire app after every edit.

This makes the development process faster.

3.5 Native User Interface Components

React Native provides components that render using native platform capabilities.

This helps applications deliver a mobile interface that feels natural on the target platform.

3.6 Large Developer Community

React Native has a large developer ecosystem with documentation, libraries, tools, and community support.

Developers can use additional packages to implement features such as navigation, animations, API integration, and authentication.

4. Requirements for React Native Development

Before creating a React Native application, you should understand the basic tools required for development.

4.1 Node.js

Node.js provides the JavaScript runtime required by the React Native development ecosystem.

It also includes npm, which is used to install and manage JavaScript packages.

Download Node.js from:

https://nodejs.org/

4.2 npm

npm stands for Node Package Manager.

It is used to install dependencies and manage packages in a JavaScript project.

To check whether npm is installed, open your terminal and execute:

npm -v

4.3 Visual Studio Code

Visual Studio Code is a code editor that can be used to write and manage React Native application code.

Download it from:

https://code.visualstudio.com/

4.4 Expo

Expo is a framework and platform that simplifies React Native development.

It provides development tools that help beginners create, test, and run React Native applications.

For this beginner tutorial, we will use Expo to create our first application.

4.5 Expo Go

Expo Go is a mobile application that allows developers to preview compatible Expo projects on a physical Android or iOS device.

It is useful for testing applications without immediately creating a standalone installation package.

5. Understanding the React Native Project Structure

When you create a React Native project using Expo, several files and folders are generated.

Some commonly used project files include:

package.json

The package.json file contains project information, dependencies, and available scripts.

Example:

{
  "name": "my-first-app",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios"
  }
}

App.js or app entry files

The application entry point depends on the Expo project template.

In a simple JavaScript-based Expo template, App.js commonly contains the main application component.

In newer Expo templates, the application may use file-based routing through an app directory.

assets

The assets directory is commonly used to store images, fonts, icons, and other static resources.

node_modules

The node_modules directory contains the packages installed through npm.

You should generally not edit files inside this directory manually.

6. Creating Your First React Native Application

Now let's create our first mobile application using Expo.

Step 1: Open the Terminal

Open the terminal in Visual Studio Code or use your system terminal.

Check whether Node.js is installed:

node -v

Check npm:

npm -v

If both commands display version numbers, the tools are available.

Step 2: Create a New Expo Project

Execute the following command:

npx create-expo-app@latest MyFirstApp

This command creates a new Expo project named MyFirstApp.

Wait until the project dependencies are installed.

Step 3: Open the Project

Move into your project directory:

cd MyFirstApp

Open the project in Visual Studio Code:

code .

Step 4: Start the Development Server

Execute:

npx expo start

Expo starts the development server and displays a QR code in the terminal or development interface.

Step 5: Run the Application

Install Expo Go on your Android device.

Make sure your computer and mobile device are connected to the same local network when using the local development connection.

Open Expo Go and scan the QR code.

Your React Native application should open on your mobile device.

If the local network connection does not work, Expo also provides alternative connection options depending on your development environment.

7. Understanding Basic React Native Components

React Native provides different components to create mobile application interfaces.

Let's understand some important components.

7.1 View Component

The View component is used as a container for organizing other components.

Example:

import { View } from 'react-native';

export default function App() {
  return (
    
    
  );
}

7.2 Text Component

The Text component is used to display text on the screen.

Example:

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

export default function App() {
  return (
    
      Hello React Native!
    
  );
}

7.3 Button Component

The Button component provides a basic interactive button.

Example:

import { View, Button } from 'react-native';

export default function App() {
  return (
    
       alert('Button Clicked!')}
      />
    
  );
}

The title property defines the button text, while onPress defines the action performed when the user presses the button.

7.4 TextInput Component

The TextInput component allows users to enter text.

Example:

import { View, TextInput } from 'react-native';

export default function App() {
  return (
    
      
    
  );
}

7.5 Image Component

The Image component displays images in a React Native application.

Example:

import { View, Image } from 'react-native';

export default function App() {
  return (
    
      
    
  );
}

The source property specifies the image location, while style defines its dimensions.

8. Practical Example: Build Your First React Native App

Now let's create a simple application that displays a welcome message, accepts a user's name, and responds when the user presses a button.

For a simple Expo project with App.js, replace its contents with the following code.

Complete Code

import React, { useState } from 'react';

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

export default function App() {

  const [name, setName] = useState('');

  const [message, setMessage] = useState(
    'Welcome to React Native!'
  );

  const handlePress = () => {

    if (name.trim() === '') {
      setMessage('Please enter your name!');
    } else {
      setMessage(`Hello, ${name}! Welcome to Param Classes.`);
    }

  };

  return (

    

      
        My First React Native App
      

      
        Learn Mobile App Development
      

      

      

      
        {message}
      

    

  );

}

const styles = StyleSheet.create({

  container: {
    flex: 1,
    backgroundColor: '#f4f6f8',
    justifyContent: 'center',
    alignItems: 'center',
    padding: 20
  },

  heading: {
    fontSize: 25,
    fontWeight: 'bold',
    marginBottom: 10,
    color: '#1e293b'
  },

  description: {
    fontSize: 16,
    marginBottom: 25,
    color: '#64748b'
  },

  input: {
    width: '100%',
    borderWidth: 1,
    borderColor: '#94a3b8',
    padding: 12,
    borderRadius: 8,
    marginBottom: 15,
    backgroundColor: '#ffffff'
  },

  message: {
    fontSize: 18,
    marginTop: 25,
    fontWeight: '600',
    textAlign: 'center',
    color: '#2563eb'
  }

});

Understanding the Code

1. Import React and useState

import React, { useState } from 'react';

React provides the component architecture, while useState allows us to manage changing data inside a functional component.

2. Import React Native Components

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

These components are used to create the application interface.

3. Create State Variables

const [name, setName] = useState('');

The name state stores the value entered by the user.

const [message, setMessage] = useState(
  'Welcome to React Native!'
);

The message state stores the text displayed below the button.

4. Create the Button Function

const handlePress = () => {

  if (name.trim() === '') {
    setMessage('Please enter your name!');
  } else {
    setMessage(`Hello, ${name}! Welcome to Param Classes.`);
  }

};

This function checks whether the user has entered a name.

If the input is empty, an error message is displayed.

Otherwise, the application displays a personalized welcome message.

5. Display the Input Field


 

The value property connects the input to the name state.

The onChangeText property updates the state whenever the user types something.

6. Handle Button Press


 

When the user presses the Submit button, the handlePress function executes.

7. Apply Styles

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

StyleSheet.create() helps organize styles for React Native components.

The flex: 1 property allows the container to occupy the available screen space.

The justifyContent property controls vertical alignment in this column layout, while alignItems controls horizontal alignment.

9. Expected Application Output

When you run the application, you should see:

  • A heading displaying "My First React Native App".

  • A description displaying "Learn Mobile App Development".

  • An input field asking for the user's name.

  • A Submit button.

  • A welcome message.

When the user enters a name such as Rahul and presses Submit, the application displays:

Hello, Rahul! Welcome to Param Classes.

If the user presses Submit without entering a name, the application displays:

Please enter your name!

10. Benefits of Learning React Native

Learning React Native provides several opportunities for developers.

Cross-Platform Skills

You can learn to build applications for multiple mobile platforms using a shared development approach.

Reusable Development Skills

React concepts such as components, props, state, and hooks can be used to organize mobile applications.

Faster Prototyping

Expo and React Native tools make it easier to create and test application ideas.

Mobile Development Opportunities

React Native skills can be useful for building business applications, educational applications, e-commerce applications, and other mobile products.

11. Best Practices for React Native Beginners

Follow these practices while learning React Native:

  1. Learn JavaScript fundamentals before moving to advanced React Native concepts.

  2. Understand JSX and component structure.

  3. Use reusable components instead of repeating the same code.

  4. Keep application code organized.

  5. Use meaningful variable and function names.

  6. Test your application on an actual mobile device when possible.

  7. Understand errors instead of simply copying solutions.

  8. Practice by creating small applications before building complex projects.

12. Conclusion

React Native is a powerful framework for developing cross-platform mobile applications using JavaScript and React.

In this tutorial, you learned what React Native is, explored its important features, understood the development environment, created your first Expo project, and worked with basic components such as View, Text, Button, TextInput, and Image.

You also built a practical application that accepts a user's name and displays a personalized welcome message.

These fundamentals provide a starting point for understanding React Native application development.

With regular practice and a clear understanding of components, state, styling, and application structure, you can gradually develop more advanced mobile applications.

13. Frequently Asked Questions (FAQs)

Q1. What is React Native?

React Native is an open-source framework that allows developers to build native mobile applications using JavaScript and React.

Q2. Is React Native used for Android and iOS development?

Yes. React Native supports Android and iOS application development using a shared codebase, although some platform-specific code may still be required.

Q3. Do I need to learn JavaScript before React Native?

Yes. Understanding JavaScript fundamentals makes it easier to learn React Native and work with its components, functions, and state management.

Q4. What is Expo in React Native?

Expo is a framework and development platform that simplifies the process of creating, testing, and building React Native applications.

Q5. What is Expo Go?

Expo Go is a mobile application used to preview compatible Expo projects on physical mobile devices.

Q6. What is JSX in React Native?

JSX is a JavaScript syntax extension that allows developers to describe user interfaces using an HTML-like syntax inside JavaScript code.

Q7. What is the use of the View component?

The View component acts as a container that helps organize and structure other components in a React Native application.

Q8. What is the use of the TextInput component?

TextInput allows users to enter and edit text, such as names, email addresses, and passwords.

Q9. Can React Native applications access native device features?

Yes. React Native applications can access device capabilities such as cameras, location services, notifications, and other native features through supported APIs and libraries.

Q10. Is React Native suitable for beginners?

Yes. Beginners who understand basic JavaScript can start learning React Native with simple components and gradually progress to complete mobile applications.

Post 1 of 39
→