react-native - 自定义控件

MyButton.js
import React,{
  Component
} from 'react';
import {
  Text,
  View,
} from 'react-native';

var MyButton = React.createClass({
  setNativeProps(nativeProps) {
    this._root.setNativeProps(nativeProps);
  },

  render() {
    return (
       this._root = component} {...this.props}>
        {this.props.label}
      
    )
  },
});

module.exports = MyButton;

使用...

    var MyButton = require('./MyButton');
    

你可能感兴趣的:(react-native - 自定义控件)