- NodeJs must be installed
- Run
npm install -g expo-clito installExpoplatform. Is not official platform but simplifies some steps. expo init projectnamecd projectname- To launch,
expo start. Will ask you for ways to open the project.wto open web browser. It will suggest to instalreact-native-webandreact-dompackages.- By scanning QR code on phone with
expo goapp on Android, app can be launched directly on phone.
- By scanning QR code on phone with
- Main code is placed on
App.js
- React-native, like React, is based on components to promote reusability.
- Props can be passed to componentes like
<Component text = "test"/>and accesed by{props.text}
- Props can be passed to componentes like
- Components and apis
- Styles are created by using
Stylesheetand must be imported fromreact-nativetoo
- To use icons included when an Expo project is started
- Search icon
- Click on the icon and get import and use codes
- Async storage to small key value storage
npm install @react-native-async-storage/async-storage- Storage is accesed by Key, and path on device is defined by the library itself.
npm install -g eas-cli- Is needed an Expo account. Then
eas loginwith username and password eas build:configureand choose platform.- For Android APK deploy, change on
eas.jsonthat was generated by thebuild:configurecommand:"preview": { "android": { "buildType": "apk" } } - To run the build
eas build -p android --profile previewwhere profile gets changes made to buildType APK. This command is using the tier account you're using on Expo - On Linux, it's possible to build locally the app
eas build --local -p android --profile preview
- Disable HyperV on Windows => Windows Features => Search HyperV and uncheck it
- Install Android Studio
- Run the simulator on Android Studio => Tools => Device Manager and run the simulator
expo start -cto delete cached data and choose Android- First time of launch, expo will be installed on simulator
- If it doesn't work, when
expo start -ccommand, type?andshift+ato select device or emulator and choose the emulator.
- If it doesn't work, when