First React Native App Example

This example demonstrates a simple react-native app.

Javascript




// Filename - App.js
  
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
  
export default function App() {
  return (
    <View style={styles.container}>
      <Text style={styles.title}>
        Your react-native project has been created
      </Text>
      <Text style={styles.subtitle}>Welcome</Text>
      <StatusBar style="auto" />
    </View>
  );
}
  
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
  title: {
    color: "green",
    fontSize: 18,
  },
  subtitle: {
    color: "red",
  },
});


Output:

Getting started with React Native

React Native, also known as RN, is a widely used mobile app framework that relies on JavaScript and It enables developers to build natively-rendered apps for both iOS and Android platforms using the same codebase was introduced by Facebook as an open-source project in 2015 and quickly became one of the leading solutions for mobile app development. Major mobile apps such as Instagram, Facebook, and Skype are powered by React Native.

Table of Content

  • What is React Native ?
  • Getting Started with React Native
  • Installing dependencies for React Native
  • First React Native App Example:
  • Things to remember while starting React Native

React Native’s success can be attributed to several reasons. Firstly, React Native allows companies to write code once and use it for both their iOS and Android apps, saving significant time and resources, Secondly, React Native was built using React, a popular JavaScript library that was already well-established when the mobile framework was released and Thirdly, the framework empowered front-end developers, who previously could only work with web-based technologies, to create robust, production-ready apps for mobile platforms.

Similar Reads

What is React Native?

React Native is a framework developed by Facebook for creating native-style apps for iOS & Android under one common language, JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now render mobile UIs for both platforms....

Getting Started with React Native

Building with React Native is extremely efficient and highly addictive but getting started can be a little tricky. React Native uses Node.js, a JavaScript runtime, to build your JavaScript code. If you don’t already have Node.js installed, it’s time to get it!...

Installing dependencies for React Native

Here we will use the Expo CLI version which makes it much smoother to run your React Native applications. Follow the below steps one by one to set up your React native environment....

First React Native App Example

This example demonstrates a simple react-native app....

Things to remember while starting React Native

...

Contact Us