Skip to content

Latest commit

 

History

History

react-native

antd-mobile-rn react-native demo

node4+ npm3+
npm i
react-native run-ios // ios
react-native run-android // android

use antd-mobile-rn in react-native project

  1. install dep
$ npm install antd-mobile-rn --save
$ npm install babel-plugin-import --save-dev
  1. config .babelrc
{"plugins": [["import", { "libraryName": "antd-mobile-rn" }]]}

sample code

import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { Button } from 'antd-mobile-rn';

class HelloWorldApp extends Component {
  render() {
    return <Button>Start</Button>;
  }
}

AppRegistry.registerComponent('HelloWorldApp', () => HelloWorldApp);