<commit_before>import React, {
  Component,
  PropTypes
} from 'react';
import {
  TouchableOpacity,
  View,
  Text
} from 'react-native';

/**
 * @author 田尘殇Sean(<EMAIL>)
 * @date 16/5/5
 */
class Button extends Component {

  static propTypes = {
    activeOpacity: PropTypes.number,
    children: PropTypes.any,
    disabled: PropTypes.bool,
    renderContent: PropTypes.func
  };

  static defaultProps = {
    activeOpacity: .6,
    disabled: false
  };

  renderContent(children, renderContent) {
    if (renderContent) {
      return renderContent();
    }

    if (typeof children === 'string' ||
      (Array.isArray(children) && typeof children[0] === 'string')) {
      return (
        <Text>{Array.isArray(children) ? children[0] : children}</Text>
      );
    }
    return <Text />;
  }


  render() {
    let {
      disabled,
      children,
      renderContent,
      ...other
    } = this.props;

    let Comp = disabled ? View : TouchableOpacity;

    return (
      <Comp {...other}>
        {this.renderContent(children, renderContent)}
      </Comp>
    );
  }

}

export default Button;
<commit_msg>去掉默认值设置<commit_after>import React, {
  Component,
  PropTypes
} from 'react';
import {
  TouchableOpacity,
  View,
  Text
} from 'react-native';

/**
 * @author 田尘殇Sean(<EMAIL>)
 * @date 16/5/5
 */
class Button extends Component {

  static propTypes = {
    activeOpacity: PropTypes.number,
    children: PropTypes.any,
    disabled: PropTypes.bool,
    renderContent: PropTypes.func
  };

  static defaultProps = {
    disabled: false
  };

  renderContent(children, renderContent) {
    if (renderContent) {
      return renderContent();
    }

    if (typeof children === 'string' ||
      (Array.isArray(children) && typeof children[0] === 'string')) {
      return (
        <Text>{Array.isArray(children) ? children[0] : children}</Text>
      );
    }
    return <Text />;
  }


  render() {
    let {
      disabled,
      children,
      renderContent,
      ...other
    } = this.props;

    let Comp = disabled ? View : TouchableOpacity;

    return (
      <Comp {...other}>
        {this.renderContent(children, renderContent)}
      </Comp>
    );
  }

}

export default Button;

{'fraction_non_alphanumeric': 0.13847541723049164, 'fraction_numerical': 0.005863779882724403, 'mean_word_length': 2.4874213836477987, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6549685', 'n_tokens_mistral': 720, 'n_tokens_neox': 712, 'n_words': 152}