赞
踩
创建一个typescript项目
npx react-native init ywh --template react-native-template-typescript
方便一键安装,以下仅是本人常用的组件,可以按需增减
yarn add react-native-webview @react-native-async-storage/async-storage react-native-animatable react-native-paper react-native-root-siblings react-native-root-toast base-64 @react-navigation/native react-native-screens react-native-safe-area-context @react-navigation/native-stack @react-navigation/bottom-tabs react-native-reanimated react-native-gesture-handler @react-navigation/drawer @react-navigation/material-bottom-tabs react-native-paper react-native-vector-icons react-native-pager-view react-native-animatable react-native-linear-gradient @ant-design/icons-react-native
大部分时候iOS端只要pod install就行了,而安卓需要手动修改一些代码或者配置文件。我把需要配置的地方列出来,防止遗忘。
配置方法见:https://reactnavigation.org/docs/getting-started/
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
这里有一个小坑,设置完成了后,要执行一下
yarn start --reset-cache
不然不会生效。
https://github.com/oblador/react-native-vector-icons#android
https://blog.csdn.net/lxyoucan/article/details/108334465
react-native-webview
提供WebView
在本机视图中呈现 Web 内容的组件。
expo install react-native-webview
https://docs.expo.io/versions/latest/sdk/webview/
一个异步的、未加密的、持久的、键值存储 API。
expo install @react-native-async-storage/async-storage
https://docs.expo.io/versions/latest/sdk/async-storage/
React Native 的声明式过渡和动画
yarn add react-native-animatable
https://github.com/oblador/react-native-animatable
yarn add react-native-paper
yarn add react-native-root-siblings
expo install @ant-design/react-native
yarn add react-native-root-toast
yarn add base-64
yarn add @react-navigation/native
expo install react-native-screens react-native-safe-area-context
yarn add @react-navigation/native-stack
yarn add @react-navigation/bottom-tabs
expo install react-native-reanimated
expo install react-native-gesture-handler
yarn add @react-navigation/drawer
expo install expo-linking
expo install expo-linear-gradient
yarn add react-native-pager-view
yarn add @react-navigation/material-bottom-tabs react-native-paper react-native-vector-icons
yarn add @react-native-community/segmented-control
yarn add @react-native-community/cameraroll
yarn add @react-native-picker/picker
React Native 的声明式过渡和动画
yarn add react-native-animatable
https://github.com/oblador/react-native-animatable
yarn add react-native-linear-gradient
https://github.com/react-native-linear-gradient/react-native-linear-gradient
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。