Executing your first React Native project
For develop with react native you need to have installed in your computer node.js and Android Studio. The node.js though npm will assist you to download the dependencies, specially the expo-cli package and Android Studio will contains the android SDK and the android device manager to assist in the developing x testing process.
The first
thing you have to do is to download the expo-cli executing the following instruction:
npm install -g expo-cli. The expo-cli will provide you means to create and then
to execute react-native apps, besides several other features such as the live reloading
of you changes.
Once expo-cli
is available, you can then create a react native project using the following instruction:
expo init. It will ask you to give a name to the project and then a template.
For template you may choose blank, as suggestion. You have to wait until the
project creation is completed.
Once it the
project is created you may run the executing the instruction: expo start. Just
remember you have to enter inside the project root directory. When the project
is complete it initiates a web application running in the address: http://localhost:19002/.
Then, for
running that in you android emulator, you have to open your android studio, open
the Android Virtual Device Manager, and then run an emulator. It is very important
to have an emulator running before try to execute your React Native project on android, otherwise an exception will be
triggered in the running process.
Once you
have the android emulator running, you may test your application on android or
clicking in the link “Run on Android device/emulator” in the left panel of your
android application or initiating the project executing expo start –android.
You may see
a step by step explanation watching the video class available in the link
below:
Comments
Post a Comment