React Native创建一个新的项目常用命令

2023-05-16

创建项目

创建一个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就行了,而安卓需要手动修改一些代码或者配置文件。我把需要配置的地方列出来,防止遗忘。

react-navigation

配置方法见:https://reactnavigation.org/docs/getting-started/

react-native-reanimated

https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
这里有一个小坑,设置完成了后,要执行一下

yarn start --reset-cache

不然不会生效。

react-native-vector-icons

https://github.com/oblador/react-native-vector-icons#android

@ant-design/icons-react-native

https://blog.csdn.net/lxyoucan/article/details/108334465

详细

WebView

react-native-webview提供WebView在本机视图中呈现 Web 内容的组件。

expo install react-native-webview

https://docs.expo.io/versions/latest/sdk/webview/

AsyncStorage

一个异步的、未加密的、持久的、键值存储 API。

expo install @react-native-async-storage/async-storage

https://docs.expo.io/versions/latest/sdk/async-storage/

react-native-animatable

React Native 的声明式过渡和动画

yarn add react-native-animatable

https://github.com/oblador/react-native-animatable

react-native-paper

yarn add react-native-paper

react-native-root-siblings

yarn add react-native-root-siblings

@ant-design/react-native

expo install @ant-design/react-native

react-native-root-toast

yarn add react-native-root-toast

base-64

yarn add base-64

react navigation

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-linking

expo install expo-linking

expo-linear-gradient

expo install expo-linear-gradient

react-native-pager-view

yarn add react-native-pager-view

Material Bottom Tabs Navigator

yarn add @react-navigation/material-bottom-tabs react-native-paper react-native-vector-icons

ant

yarn add @react-native-community/segmented-control
yarn add @react-native-community/cameraroll
yarn add @react-native-picker/picker

React Native 篇

react-native-animatable

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

React Native创建一个新的项目常用命令 的相关文章

随机推荐

  • Docker使用笔记

    软件安装 https docs docker com engine install ubuntu 下载镜像 span class token function docker span pull ubuntu 创建一个CONTAINER 示例
  • ubuntu编译安装最新的tmux

    通过apt get安装的tmux版本比较旧 xff0c 我喜欢使用最新的版本 那就自己编译安装一下吧 很简单 xff0c 耗时1分钟左右 环境 操作系统 xff1a Ubuntu 20 04 3 LTS 安装的tmux版本 xff1a tm
  • Ubuntu Linux 更改主机名(hostname)

    操作 编辑 etc hostname文件 span class token function vim span etc hostname 文件内容修改成自己想要的名称 修改完后 xff0c 重启机器就生效了 span class token
  • docker文件目录迁移

    docker默认存放路径是 var lib docker xff0c 按理来说没有什么问题 但是在我安装操作系统时 xff0c 分区空间分的太少了 xff08 50G xff09 但是 home目录就非常大了 所以我想把docker的默认路
  • ubuntu开启ssh服务

    环境 我的测试环境是 xff1a docker中的Ubuntu 20 04 3 LTS 安装openssh server span class token function sudo span span class token functi
  • neovim无法中文显示的问题

    场景 中文的语言环境 xff0c 其他支持中文的程序 正常能显示中文 xff0c 比如 date xff0c vim都可以支持中文 就neovim显示的是英文 我下载的neovim是全功能的版本 xff0c 支持中文的 所以排除软件的原因
  • Netty使用Google Protobuf进行编解码

    文章目录 一 概述1 编解码基础2 Netty编解码器3 Protobuf概述 二 Protobuf基本使用1 引入jar包2 下载Protobuf3 编写Student proto4 生成StudentPOJO类5 服务器端6 客户端7
  • ranger没有那个文件或目录: ‘screen‘: ‘screen‘

    背景 首先ranger是正常安装 xff0c 正常环境下也是可以正常使用的 当我在tmux中使用ssh远程 xff0c 然后使用ssh远程的机器中的ranger xff0c 就发现ranger打开报错了 嵌套层级 xff1a tmux ss
  • ubuntu搭建nvim开发环境准备工作

    以下代码 xff0c 仅供方便复制使用的 想了解细节 xff0c 可以参考 xff1a windows10安装子系统Ubuntu 20 04 https blog csdn net lxyoucan article details 1198
  • Failed to execute child process “dbus-launch“

    场景 在ubuntu中搭建vnc桌面环境 xff0c 安装 Minimal Xfce Desktop span class token comment 精简安装 span span class token function sudo spa
  • ubuntu图形界面乱码解决办法

    现象 ubuntu的vnc远程桌面中出现了一些乱码 原因分析 从上图中可以看出英文显示正常 xff0c 那么可以判断应该是中文乱码导致的 应该是系统中没有安装中文字体导致 解决办法 方法1 xff1a 使用英文的界面 xff0c 但是我还是
  • Kylin V10 SP1(ubuntu)编译安装python3新版本

    系统自带的python太旧了 xff0c 所以想编译安装最新版本的python 环境 span class token function cat span etc release span class token assign left v
  • docker容器安装图形桌面

    文章目录 视频教程版本信息创建一个CONTAINERubuntu官方国内源docker镜像unminimize中文环境设置中文环境 安装安装TigerVNC Server安装 xfce4精简版本 配置设置vnc密码 vnc xstartup
  • ubuntu官方国内源

    背景 之前我一直在使用中科大的源 xff0c 还是挺快的 一直也没有感觉有什么问题 直到最近在折腾vnc xff0c 发现中科大的源有一些包会404 xff0c 安装不了 而我在vmware中的正好是默认的cn archive ubuntu
  • iterm2禁用鼠标选择复制

    iterm2默认选中文字就自动复制到剪切板 xff0c 方便是挺方便 但是有时候 xff0c 复制了一段文字想贴到iterm2中 xff0c 结果鼠标一滑 xff0c 不小心选择到了文字了 xff0c 之前复制的内容就被替换了 那么怎么关闭
  • Ant Design for React Native精简笔记

    背景 Ant Design是一套不错的UI组件库 xff0c 功能强大 但是依赖了很多其他的组件 xff0c 在RN6 3以后要自己安装以下组件才能正常使用 span class token function yarn span span
  • yarn使用说明

    yarn优点 速度超快 Yarn 缓存了每个下载过的包 xff0c 所以再次使用时无需重复下载 同时利用并行下载以最大化资源利用率 xff0c 因此安装速度更快 超级安全 在执行代码之前 xff0c Yarn 会通过算法校验每个安装包的完整
  • Netty编解码器,Netty自定义编解码器解决粘包拆包问题,Netty编解码器的执行过程详解

    文章目录 一 编解码器概述1 编解码器概述2 编码器类关系图3 解码器类关系图 二 以编解码器为例理解入站出站1 Server端2 Client端3 编解码器3 执行查看结果4 注意事项 三 Netty其他内置编解码器1 Replaying
  • ERROR Error: Reanimated 2 failed to create a worklet

    报错 To reload the app press span class token string 34 r 34 span To span class token function open span developer menu pr
  • React Native创建一个新的项目常用命令

    创建项目 创建一个typescript项目 npx react native init ywh template react native template typescript 导入库 整合 方便一键安装 以下仅是本人常用的组件 xff0