React Native
Url
Main language
Extends from
Framework for
GUI
Supported platforms
Android
Android TV
iOS
tvOS
macOS
Windows
Web
Easy to start with if you are used to ReactJs
Shares the same principles
Components, reactivity
Code and modules are not HTML+CSS
Not portable by default
It's not really HTML
Rendered values returned by components need to have text inside a <Text> tag
H1 tags are rendered by doing <Text h1>...</Text>
View tags are used instead of divs
Styles are not created through CSS files, but through internal structures
APK generation
Debug
mkdir android/app/src/main/assets/
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android
./gradlew assembleDebug
See
./app/build/outputs/apk/debug/app-debug.apk
Size
41M
Activating release options on debug (build.gradle)
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
./gradlew assembleDebug
Size
41M
[ 0/1 ] Articles
How I Reduced the Size of My React Native App by 86% | by Aswin Mohan
blogpostUrl
https://medium.com/@aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640
Base size
41M
In build.gradle
Set def enableProguardInReleaseBuilds = true
=Add def enableSeparateBuildPerCPUArchitecture = true
Now moved and activated by default
Result size
41M
Will probably need a real release build to be appreciated...