{"id":15020094,"url":"https://github.com/xuyuanxiang/umi-react-native","last_synced_at":"2025-10-25T00:32:05.283Z","repository":{"id":57385612,"uuid":"257265066","full_name":"xuyuanxiang/umi-react-native","owner":"xuyuanxiang","description":"umi preset plugins for react-native","archived":false,"fork":false,"pushed_at":"2020-06-28T02:11:10.000Z","size":744,"stargazers_count":61,"open_issues_count":8,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-30T00:36:02.916Z","etag":null,"topics":["ant","ant-design","dva","dvajs","expo","haul","multibundle","multiply-bundles","react-native","react-navigation","umi","umi-plugin","umijs","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuyuanxiang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-20T11:51:37.000Z","updated_at":"2024-02-22T00:32:58.000Z","dependencies_parsed_at":"2022-08-29T11:11:21.067Z","dependency_job_id":null,"html_url":"https://github.com/xuyuanxiang/umi-react-native","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyuanxiang%2Fumi-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyuanxiang%2Fumi-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyuanxiang%2Fumi-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyuanxiang%2Fumi-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuyuanxiang","download_url":"https://codeload.github.com/xuyuanxiang/umi-react-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238053514,"owners_count":19408699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant","ant-design","dva","dvajs","expo","haul","multibundle","multiply-bundles","react-native","react-navigation","umi","umi-plugin","umijs","webpack"],"created_at":"2024-09-24T19:54:34.914Z","updated_at":"2025-10-25T00:31:59.774Z","avatar_url":"https://github.com/xuyuanxiang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# umi-react-native\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b2f18b86af4243aa93fe4e679b24341b)](https://app.codacy.com/manual/xuyuanxiang/umi-react-native?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=xuyuanxiang/umi-react-native\u0026utm_campaign=Badge_Grade_Dashboard) ![NPM Downloads](https://badgen.net/npm/dt/umi-preset-react-native) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![](https://github.com/xuyuanxiang/umi-react-native/workflows/iOS%20E2E%20Tests/badge.svg?style=flat-square)](https://github.com/xuyuanxiang/umi-react-native/actions?query=workflow%3A%22iOS+E2E+Tests%22) [![Android E2E Tests](https://github.com/xuyuanxiang/umi-react-native/workflows/Android%20E2E%20Tests/badge.svg?style=flat-square)](https://github.com/xuyuanxiang/umi-react-native/actions?query=workflow%3A%22Android+E2E+Tests%22)\n\n使用 [umi@3.x](https://umijs.org/) 加速 [react-native](https://reactnative.dev/) 开发效率：\n\n- **零配置**，添加[DvaJS](https://dvajs.com/)，[@ant-design/react-native](https://rn.mobile.ant.design/index-cn)... 等依赖后开箱即用；\n- 只需要专注页面 UI 和业务领域模型的实现，所有编译配置，框架运行所需 HOC 和 Context Provider 全部由 umi 搞定；\n- 路由方案默认使用 [umi](https://umijs.org/) 内置的[react-router](https://reacttraining.com/react-router/)，**可选**[react-navigation](https://reactnavigation.org/)；\n- 启用[dynamicImport](https://umijs.org/config#dynamicimport)配置后，支持拆包，运行时从本地按需加载 JS bundle 文件。了解详情：[使用 haul 拆包](#%E4%BD%BF%E7%94%A8-haul-%E6%8B%86%E5%8C%85)\n\n| NPM 包 | 当前版本 | 简介 |\n| --- | --- | --- |\n| [umi-plugin-antd-react-native](packages/umi-plugin-antd-react-native) | [![npm version](https://img.shields.io/npm/v/umi-plugin-antd-react-native.svg?style=flat)](https://www.npmjs.com/package/umi-plugin-antd-react-native) | 为[@ant-design/react-native](https://rn.mobile.ant.design/index-cn)提供**按需加载**，**主题**定制、预设、切换，**国际化**支持，在[expo](https://expo.io/)中[链接字体图标](https://rn.mobile.ant.design/docs/react/introduce-cn#%E9%93%BE%E6%8E%A5%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87)。 |\n| [umi-preset-react-native](packages/umi-preset-react-native) | [![npm version](https://img.shields.io/npm/v/umi-preset-react-native.svg?style=flat)](https://www.npmjs.com/package/umi-preset-react-native) | 基础包，让[umi](https://umijs.org/)具备开发 RN 的能力。**需要 [react-native](https://reactnative.dev/) 0.44.0 及以上版本（\u003e=0.44.0）** |\n| [umi-preset-react-navigation](packages/umi-preset-react-navigation) | [![npm version](https://img.shields.io/npm/v/umi-preset-react-navigation.svg?style=flat)](https://www.npmjs.com/package/umi-preset-react-navigation) | 使用[react-navigation](https://reactnavigation.org/)替换[react-router](https://reacttraining.com/react-router/)开发地道的原生应用。**需要 [react-native](https://reactnative.dev/) 0.60.0 及以上版本（\u003e=0.60.0）** |\n| [umi-renderer-react-navigation](packages/umi-renderer-react-navigation) | [![npm version](https://img.shields.io/npm/v/umi-renderer-react-navigation.svg?style=flat)](https://www.npmjs.com/package/umi-renderer-react-navigation) | 支持以[react-navigation](https://reactnavigation.org/)的方式来渲染[react-router](https://reacttraining.com/react-router/)所定义的路由模型。无须单独安装该依赖 |\n| [umi-react-native-multibundle](packages/umi-react-native-multibundle) | [![npm version](https://img.shields.io/npm/v/umi-react-native-multibundle.svg?style=flat)](https://www.npmjs.com/package/umi-react-native-multibundle) | RN Bridge API，为 JS 层提供按需加载 Bundle 文件的能力。**需要 [react-native](https://reactnative.dev/) 0.62.2 及以上版本（\u003e=0.62.2）** |\n\n## 快速开始\n\numi 在 RN 中仅用来生成中间代码（临时文件），介于**编码**和**构建**的之间，旨在引入 umi 的开发姿势来提升 RN 编程体验。\n\n下游可以使用：\n\n- [React Native CLI](https://github.com/react-native-community/cli/blob/master/docs/commands.md#commands)：RN 官方开发/打包工具；\n- [expo](https://expo.io/)：不需要搭建 iOS 和 Android 开发环境，工程目录干净清爽，添加 RN 依赖方便快捷；\n- [haul](https://github.com/callstack/haul)：第三方 RN 打包器，使用 webpack。缺点是不支持：Fast Refresh、Live Reloading、Hot Replacement。\n\n**umi-preset-react-native**会探测用户工程内的依赖，自动为这些工具生成所需的**配置文件**和**入口文件**。\n\n通常你只需要选择其中一款，如果全都要请查看：[umi-preset-react-native 扩展配置](https://github.com/xuyuanxiang/umi-react-native/blob/master/docs/Configuration.md#umi-preset-react-native-%E6%89%A9%E5%B1%95%E9%85%8D%E7%BD%AE)。\n\n### 使用 React Native CLI\n\n示例工程：[UMIRNExample](https://github.com/xuyuanxiang/UMIRNExample#readme)\n\n### 使用 expo\n\n示例工程：[UMIExpoExample](https://github.com/xuyuanxiang/UMIExpoExample#readme)\n\n### 使用 haul 拆包\n\n当 RN 工程满足下列条件才会拆包：\n\n- 安装了[haul](https://github.com/callstack/haul)打包器；\n- 开启了[dynamicImport](https://umijs.org/config#dynamicimport)配置。\n\n示例工程：[UMIHaulExample](https://github.com/xuyuanxiang/UMIHaulExample#readme)\n\n## 文档\n\n- [发布日志](/CHANGELOG.md)\n- [命令行工具](/docs/Command.md)\n- [配置](/docs/Configuration.md)\n- [路由](/docs/Router.md)\n- [FAQ](/docs/FAQ.md)\n  - [hmrClient.send is not a function](/docs/FAQ.md#hmrclientsend-is-not-a-function)\n  - [使用 @ant-design/react-native 组件时，报错：Unrecognized font family 'antoutline'](/docs/FAQ.md#%E4%BD%BF%E7%94%A8-ant-designreact-native-%E7%BB%84%E4%BB%B6%E6%97%B6%E6%8A%A5%E9%94%99unrecognized-font-family-antoutline)\n  - [Unable to Resolve Module in React Native App](/docs/FAQ.md#unable-to-resolve-module-in-react-native-app)\n  - [Attempted to assign to readonly property](/docs/FAQ.md#attempted-to-assign-to-readonly-property)\n\n## 案例\n\n- [单独为某个页面设置导航条](https://github.com/xuyuanxiang/umi-react-native/blob/master/docs/Router.md#%E6%A1%88%E4%BE%8B%E5%8D%95%E7%8B%AC%E4%B8%BA%E6%9F%90%E4%B8%AA%E9%A1%B5%E9%9D%A2%E8%AE%BE%E7%BD%AE%E5%AF%BC%E8%88%AA%E6%9D%A1)\n- [持久化导航状态（App 复苏后状态恢复）](https://github.com/xuyuanxiang/umi-react-native/blob/master/docs/Router.md#%E6%A1%88%E4%BE%8B%E6%8C%81%E4%B9%85%E5%8C%96%E5%AF%BC%E8%88%AA%E7%8A%B6%E6%80%81)\n- [自定义页面转场动画](https://github.com/xuyuanxiang/umi-react-native/blob/master/docs/Router.md#%E6%A1%88%E4%BE%8B%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A1%B5%E9%9D%A2%E8%BD%AC%E5%9C%BA%E5%8A%A8%E7%94%BB)\n\n## 测试\n\n[端到端测试](https://github.com/xuyuanxiang/umi-react-native/actions)\n\n测试用例：[example/e2e/app.spec.js](example/e2e/app.spec.js)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuyuanxiang%2Fumi-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuyuanxiang%2Fumi-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuyuanxiang%2Fumi-react-native/lists"}