- NodeJs must be installed
- Run
npm install -g expo-cli
to installExpo
platform. Is not official platform but simplifies some steps. expo init projectname
cd projectname
- To launch,
expo start
. Will ask you for ways to open the project.w
to open web browser. It will suggest to instalreact-native-web
andreact-dom
packages.- By scanning QR code on phone with
expo go
app 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
Stylesheet
and must be imported fromreact-native
too
- 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 login
with username and password eas build:configure
and choose platform.- For Android APK deploy, change on
eas.json
that was generated by thebuild:configure
command:"preview": { "android": { "buildType": "apk" } }
- To run the build
eas build -p android --profile preview
where 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 -c
to delete cached data and choose Android- First time of launch, expo will be installed on simulator
- If it doesn't work, when
expo start -c
command, type?
andshift+a
to select device or emulator and choose the emulator.
- If it doesn't work, when