Updated 29 October 2024
In this blog, I will explain the installation and setup of a React Native application.
To start with React Native, set up your environment using either Expo for simplicity or the React Native CLI for more control. Both require Node.js and a package manager like npm.
To set up React Native with Expo and React Native CLI, follow the instructions below for each option.
1 |
npm install -g expo-cli |
1 |
expo init MyApp |
1 |
cd MyApp |
1 |
expo start |
You can create a React Native application using either the Quickstart method or the standard approach, both requiring Node.js installation, which I assume you have already completed.
you can use npm to install the create-react-native-app
command line utility:
1 |
npm install -g create-react-native-app |
Then run the following commands to create a new React Native project called “Awesome Project”:
1 |
create-react-native-app AwesomeProject cd AwesomeProject npm start |
This will start a development server for you.
but I have faced an issue on Quickstart cookies management is not working.
1 |
npm install -g react-native-cli |
1 2 3 4 5 6 7 8 9 10 11 12 |
$ cd ~ $ git clone https://github.com/facebook/watchman.git $ cd watchman/ $ git checkout v4.7.0 $ sudo apt-get install -y autoconf automake build-essential python-dev $ ./autogen.sh $ ./configure $ make $ sudo make install $ watchman --version $ echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server |
Now create first React Native Application.
1 |
react-native init AwesomeProject |
Now Run your first Application on your Device. First of all, we add “local.property” file in the Android folder structure of the Application that has your SDK path.
then use commands on your terminal.
1 2 |
cd AwesomeProject react-native run-android |
Now you look it’s run on your device.
Some useful commands which we are aware
1 2 |
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p |
1 2 |
npm add @babel/runtime npm install |
1 2 |
adb kill-server adb start-server |
All setups and configurations have been done. So, we need to modify our App.js file for our Application.
To begin with React Native, install Node.js and a package manager, then set up your environment using either Expo for simplicity or React Native CLI for full native control, depending on your needs.
In conclusion, choose Expo for ease or the React Native CLI for full control. Both setups require Node.js and a package manager, enabling quick app development.
Read more interesting React Native Blogs by Mobikul.
Thanks for reading this blog.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.