Skip to content

Commit

Permalink
Merge pull request #127 from vmakhaev/master
Browse files Browse the repository at this point in the history
Toggle add toggled prop
  • Loading branch information
Hai Nguyen committed Dec 6, 2014
2 parents 0477ac3 + fe4508f commit 3361799
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/js/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ var React = require('react'),
var Toggle = React.createClass({

propTypes: {
onToggle: React.PropTypes.func
onToggle: React.PropTypes.func,
toggled: React.PropTypes.bool
},

mixins: [Classable],

getInitialState: function() {
getDefaultProps: function() {
return {
toggled: false
};
},

getInitialState: function() {
return {
toggled: this.props.toggled
}
},

Expand Down

0 comments on commit 3361799

Please sign in to comment.