What is React Native?
is an open-source cross-platform mobile application development framework developed by Facebook in 2015. It is widely used by developers, from advanced developers in Android and iOS to React beginners and even people who are getting started with programming for the first time in their career. Since its initial release in 2015, the popularity of the framework is consistently growing.
Nearly 58% of all respondents on the Stack Overflow Developer Survey 2020 state that they are either using React Native and have expressed interest in continuing to develop apps with it. React Native is considered a preferred alternative of Flutter, an open-source cross-platform mobile application development framework developed by Google. React Native uses messages from the JavaScript thread instead of HTML or CSS. React Native also allows developers to write native code in languages such as Java for Android and Objective-C or Swift for iOS, which makes it even more flexible.
In general, there are two possible ways to get started with React Native:
- Expo CLI
- React Native CLI
In this article, we will discuss creating the react native project using react-native CLI.
Create React Native app using React Native CLI
Run the following commands to create a new React Native project named FirstProject
using React Native CLI:
npx react-native init FirstProject
cd FirstProject
npx react-native start
This will start a Metro Bundler development server for you. Once you’ve set up Android Studio or Xcode, you can launch your app on an Android virtual device or real device using USB by running:
npx react-native run-android
On the iOS Simulator (macOS only) you can do this by running:
npx react-native run-ios
You should be able to see the app running in the emulator/simulator or a real device.
Conclusion
With the growing popularity in the domain of cross-platform solutions, React Native continues to leave its mark for the developers and industries keen to make use of it. We hope this article helps you get started with React Native and launch your own apps!
Hope you have got some insights about react-native CLI in the next article we will create the react native app using expo client.
Please write to me @ info.anishgarg@gmail.com for any query.
Signing off for the day, Thanks a ton !! Have a nice time ahead.