Skip to content

Commit

Permalink
[fixed] Add missed propType validation for Button 'type' property
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKVal committed Jun 30, 2015
1 parent 557e470 commit 89ea6ed
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import BootstrapMixin from './BootstrapMixin';
import CustomPropTypes from './utils/CustomPropTypes';
import ButtonInput from './ButtonInput';

const Button = React.createClass({
mixins: [BootstrapMixin],
Expand All @@ -14,14 +15,18 @@ const Button = React.createClass({
navDropdown: React.PropTypes.bool,
componentClass: CustomPropTypes.elementType,
href: React.PropTypes.string,
target: React.PropTypes.string
target: React.PropTypes.string,
/**
* Defines HTML button type Attribute
* @type {("button"|"reset"|"submit")}
*/
type: React.PropTypes.oneOf(ButtonInput.types)
},

getDefaultProps() {
return {
bsClass: 'button',
bsStyle: 'default',
type: 'button'
bsStyle: 'default'
};
},

Expand Down Expand Up @@ -68,6 +73,7 @@ const Button = React.createClass({
return (
<Component
{...this.props}
type={this.props.type || 'button'}
className={classNames(this.props.className, classes)}>
{this.props.children}
</Component>
Expand Down

0 comments on commit 89ea6ed

Please sign in to comment.