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.
Contact Us