Please install node.js if you haven’t already done. You can check if you have node already installed by using following command:
brew install node
Use brew commands given above to install node.
Create First App
npm install -g create-react-native-app
Check Create React Native App introduction here.
cd AwesomeProject npm start
npm start runs the app in an interactive fashion.
I have attached the screenshot of terminal and the webpage that opens in the browser after we do npm start.
Run The App In Your Mobile Device
- Install the Expo client on your ios/android device from play store or ios store
- Connect the mobile device to the same wireless network on which the laptop/development environment is connected to
- Scan the QR code shown on terminal or the web page using the expo app
The expo app should look like the screenshot look like below:
Hello World App
Open your AwesomeProject folder in Sublime Text. Your file structure should look like this:
Open App.js and add the following code:
Reload the metro builder in terminal by pressing r.
Check the Hello World! shown on app in expo.
<View> <Text>Hello world!</Text> </View>