Skip to content

Commit

Permalink
Toggle add toggled prop
Browse files Browse the repository at this point in the history
  • Loading branch information
vmakhaev committed Dec 6, 2014
1 parent ccf5b36 commit fe4508f
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 fe4508f

Please sign in to comment.