UNPKG

react-native-android-kit

Version:

A set of native Android UI components and modules for React Native framework

44 lines (39 loc) 923 B
import React, { PureComponent, PropTypes } from "react"; import { View, TouchableWithoutFeedback, requireNativeComponent } from "react-native"; const NativeComponent = requireNativeComponent("ButtonAndroid", ButtonAndroid, {}); export class ButtonAndroid extends PureComponent { static propTypes = { ...View.propTypes, ...TouchableWithoutFeedback.propTypes, backgroundColor: PropTypes.string, textColor: PropTypes.string, text: PropTypes.string, textSize: PropTypes.number }; static defaultProps = { textSize: 15, textColor: "black", }; constructor(props) { super(props); } render() { return ( <TouchableWithoutFeedback {...this.props}> <NativeComponent style={this.props.style} backgroundColor={this.props.backgroundColor} textColor={this.props.textColor} textSize={this.props.textSize} text={this.props.text} /> </TouchableWithoutFeedback> ); } }