饭疏食饮水
子曰:“饭疏食饮水,曲肱而枕之,乐亦在其中矣。不义而富且贵,于我如浮云。”
基于 ReactNative 生态开发移动应用的踩坑记录。
文档
- React Native - RN 官方文档
- Expo - SDK 和在线打包的平台
- React - React 官方文档
路由
- React Navigation -
Routing
and navigation for Expo and React Native apps. - React Navigation Example - Examples - React Navigation Example
UI 库
Library | Documentation |
---|---|
React Native Paper | Link |
React Native UI Lib | Link |
React Native Elements | Link |
NativeBase | Link |
React Native UI Kitten | Link |
React Native iOS Kit | Link |
Fluent UI | Link |
Tamagui | Link |
推荐的库
Our mission is to provide a full suite of well-integrated components built with Material Design in mind. However, many components already have better well maintained implementations.
Here are some of the libraries we recommend:
Tabs
react-native-community/react-native-tab-view Material Design themed swipeable tabs, maintained by @satya164 and @mosdnk.
react-native-paper-tabs Material Design themed swipeable tabs for React Native Paper, maintained by @RichardLindhout
Bottom sheet
osdnk/reanimated-bottom-sheet An implementation of the bottom sheet behaviour, maintained by @mosdnk.
gorhom/react-native-bottom-sheet An implementation of the bottom sheet behaviour, maintained by @Gorhom.
Date Picker
web-ridge/react-native-paper-dates Material Design themed date picker, maintained by @RichardLindhout react-native-community/react-native-datetimepicker
Time Picker
web-ridge/react-native-paper-dates Material Design themed time picker, maintained by @RichardLindhout
System Colors
pchmn/expo-material3-theme Retrieve Material 3 system colors from Android 12+ devices
其他:
- React Native Directory
- Async Storage - 本地存储
- React Native Gesture Handler - 手势
- React Native Reanimated - 动画
- react-native-vector-icons - 矢量图标
- @expo/vector-icons - 矢量图标
- PanResponder - 手势响应
- React Native Multiple Image Picker - 图片多选
- Expo Config Plugins - 插件
调试:
winget install openssl
choco install watchman
常用命令:
{
"build-ios": "eas build -p ios --profile preview --clear-cache",
"build-apk": "cd android && sh ./gradlew assembleRelease "
}
- 生成 APK
cd android
./gradlew assembleRelease
- 生成 AAB
cd android
./gradlew bundleRelease
- 测试应用
npx react-native run-android --variant=release
- 预构建
npx expo prebuild
- eas 构建
npx eas build -p ios --profile development
npx eas build -p android --profile development
- eas ios 模拟器
npx eas build -p ios --profile development
- iOS 清理缓存
npx expo prebuild
cd ios
bundle install
bundle exec pod install
cd ios && rm -rf Pods && rm -rf build && pod cache clean --all && pod install && cd ..
- iOS 本地打包
npx react-native run-ios --configuration=release --verbose
npx expo run:ios --configuration Release
- eas 本地打包
eas build -p ios --profile preview --clear-cache --local
- eas 添加设备
// eas device:create
- 解决重复下载依赖
copy .\\android_download\\* .\\node_modules\\expo-modules-core\\android\\build\\downloads