react native中引入antd-mobile
2018-01-30 17:01
369 查看
1.安装
2.编辑 .babelrc
3.使用
antd-mobile与
babel-plugin-import
yarn add antd-mobile react-dom yarn add --dev babel-plugin-import
2.编辑 .babelrc
{"plugins": [["import", { "libraryName": "antd-mobile" }]]}
3.使用
import React, { Component } from 'react'; import { AppRegistry } from 'react-native'; import { Button } from 'antd-mobile'; class HelloWorldApp extends Component { render() { return <Button>Start</Button>; } } AppRegistry.registerComponent('HelloWorldApp', () => HelloWorldApp);
相关文章推荐
- 在react-native中引入antd-mobile遇到的问题
- react-native使用蚂蚁金服的antd-mobile组件库教程
- 现有Android项目引入ReactNative
- 基于React-Native及Redux的Immutable.js引入
- React Native for Android项目引入
- 现有Android项目引入ReactNative
- 基于React-Native及Redux的Immutable.js引入
- 在已有的项目中引入react native
- 现有Android项目引入ReactNative
- create-react-app 引入 antd 及 解决 antd 样式无法显示的bug
- create-react-app + antd-mobile配置
- 使用Create-React-App脚手架创建antd-mobile开发环境 (附 github 源码)
- react项目的组件库antd-mobile
- 现有Android项目引入ReactNative
- react项目的组件库antd-mobile
- react native关于 从react中引入PropTypes报错的问题
- Create-React-App创建antd-mobile开发环境
- 现有Android项目引入ReactNative
- React Native引入第三方库
- react应用更新引入react-native-code-push