import {React} from "modules"; export default class Checkbox extends React.Component { constructor(props) { super(props); this.onClick = this.onClick.bind(this); this.state = {checked: this.props.checked || false}; } render() { return
{this.props.text}
; } onClick() { this.props.onChange(!this.state.checked); this.setState({checked: !this.state.checked}); } }