针对@ant-design/react-native的umi插件。
了解如何使用umi开发 RN 应用,请移步至:umi-react-native
在 RN 工程目录下,使用 yarn 安装umi-plugin-antd-react-native:
yarn add umi-plugin-antd-react-native --dev
接下来根据你的 RN 工程所选用的开发工具,安装:
在 RN 工程目录下,使用 yarn 安装@ant-design/react-native
:
yarn add @ant-design/react-native
链接 @ant-design/react-native 字体图标资源文件:
yarn react-native link
# 等价于: ./node_modules/.bin/react-native link
如需使用@ant-design/[email protected]
请按照:安装 & 使用操作。
在 RN 工程目录下,使用 expo 安装@ant-design/react-native
和expo-font
:
expo install @ant-design/react-native expo-font
umi-plugin-antd-react-native已经为 @ant-design/react-native 做了以下支持:
- 添加按需加载(babel-plugin-import)配置;
- 使用Provider作为应用根节点;
- 在 expo 中链接字体图标。
开发者直接引入想用组件即可。
目前已经支持:使用 umi theme 配置覆盖 @ant-design/react-native 的主题:
// .umirc.js
export default {
theme: {
color_text_base: '#000000',
modal_zindex: 999,
// ...
},
};
TODO:
- 支持在运行时动态切换
@ant-design/react-native
主题/皮肤。
TODO:
- 支持通过 umi 配置修改
@ant-design/react-native
初始默认的语言文件;- 支持在运行时动态切换
@ant-design/react-native
语言文件;- 支持添加新的
@ant-design/react-native
语言文件。