Today we will learn about React Native and we will set the environment and test the basic app on Android and IOS devices.
React Native is an open source app framework developed by Facebook, Inc. It is used to build Android, Android TV, iOS, MacOS, tvOS, Web, Windows and UWP applications by empowering developers to use the React framework and native platform capabilities. To work with React Native, you will need to have a basic understanding of JavaScript as it uses JavaScript to build a mobile application.
Someone can think, are React Native apps web applications? The answer to this question is React Native apps are not web applications. They work on a mobile device, and do not load over the browser. It is also not a Hybrid app that builds over Ionic, Phone Gap, etc.
Prerequisite:
Basics of HTML, CSS, JS, ReactJS. NodeJs should be installed.
Some Key Advantages of React native:
React Native is Community-driven.
Maximum code reuse & cost saving.
Live reload.
Strong performance for mobile environments.
Modular and intuitive.
Cross Platform.
Environment Setup
If you are new to mobile development, the easiest way to get started with expo CLI. To install expo just open the terminal and paste the following line.
npm install -g expo-cli
If you are familiar with mobile development, you can use React native CLI. We will use this in our today’s tutorial. You will need Node, the React Native command line interface, a JDK, and Android Studio.
React Native Command Line Interface
React Native has a built-in command line interface. Using runtime CLI with current version is much better rather than using it globally. f you previously installed a global react-native-cli
package, please remove it as it may cause unexpected issues.
Creating New App
Open terminal at your desire folder and type npx react-native init FirstProject. Select New Template and it will take some time to install the required dependencies.
First Project
Congratulations 🎉 🎊. You have setup your first React Native App. Now to run this app type cd FirstProject and then type npx-react-native run-android at terminal.
React Native default view for new project.
Congratulations! You’ve successfully run and modified your first React Native app.
Hurrrrrrrrrahh!!!!
Thank You. Please do follow me for further tutorial on React Native. Have a good day.