Skip to content

Commit

Permalink
Fix checkbox readme
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Dec 3, 2015
1 parent 16de3b4 commit c8246f5
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions components/checkbox/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,33 @@
import Checkbox from 'react-toolbox/lib/checkbox';

class TestCheckbox extends React.Component {
state = {
check1: true,
check2: false
};
state = { check1: true, check2: false };

handleChange = (field, value) => {
this.setState({ [field]: value });
this.setState({...this.state, [field]: value});
};

render () {
return (
<div>
<Checkbox
checked={this.state.check1}
label="Checked option"
onChange={this.handleChange.bind(this, 'check1')}
<Checkbox
checked={this.state.check1}
label="Checked option"
onChange={this.handleChange.bind(this, 'check1')}
/>
<Checkbox
checked={this.state.check2}
label="Unchecked option"
<Checkbox
checked={this.state.check2}
label="Unchecked option"
onChange={this.handleChange.bind(this, 'check2')}
/>
<Checkbox
checked
disabled
label="Disabled checkbox"
<Checkbox
checked
disabled
label="Disabled checkbox"
/>
</div>
);
}
}
}
```

Expand Down

0 comments on commit c8246f5

Please sign in to comment.