1、创建 react-native 项目

react-native init app03

2、安装组件

npm install antd-mobile-rn --save

3、配置按需加载

npm install babel-plugin-import --save-dev

// .babelrc 文件中增加下面代码
"plugins": [
[
"import",
{
"libraryName": "antd-mobile-rn"
}
]
]

4、使用 antd-mobile-rn 组件进行开发

App.js

import React, {Component} from 'react';

// 导入组件
import { Button } from 'antd-mobile-rn'; type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}> // 使用组件
<Button type='primary'>按钮</Button>
</View>
);
}
} const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
}
});

展示效果:

最新文章

  1. 项目游戏开发日记 No.0x000005
  2. rpc框架之 avro 学习 2 - 高效的序列化
  3. 浅谈VB.Net 程序的编译和动态编译
  4. I/O流——File类及使用
  5. Xcode 升级成Xcode 8 版本以后,出现 Signing for &quot;sqlite3--test&quot; requires a development team. 问题的解决
  6. 工作随笔——mysql子查询删除原表数据
  7. 使用spring cloud实现分布式配置管理
  8. HDU 4419 Colourful Rectangle(线段树+扫描线)
  9. Redis Cluster 3.0搭建与使用
  10. Java开发中经典的小实例-(if(参数){}else{})
  11. 那传说中的P、NP以及NPC问题
  12. 查看linux系统的版本
  13. ajax.js
  14. fedora 设置命令别名
  15. 解决新版Emacs的警告:Warning (initialization): Your load-path...
  16. LeetCode第[15]题(Java):3Sum 标签:Array
  17. php使用file_get_contents请求微信接口失败
  18. 用UE4蓝图制作FPS_零基础学虚幻4第二季
  19. bootstrap-table 使用遇到的问题总结
  20. json 删除、添加对象

热门文章

  1. 转: 苹果APNS的说明
  2. iOS11
  3. Oracle基础(三) 表空间
  4. HTML to PDF pechkin
  5. beyond compare 软件学习
  6. Spring 应用外部属性文件 配置 context 错误
  7. 转:HTTP ---HTTP头的编码问题(Content-Disposition)
  8. quick-cocos2d-x3.2 scheduler使用注意事项
  9. 【cocos2d-x 3.x 学习笔记】对象内存管理
  10. css 用 display: inline-block; 代替 float