'use strict'; import React from 'react'; import AlertMixin from '../../mixins/alert_mixin'; let InputCheckbox = React.createClass({ propTypes: { submitted: React.PropTypes.bool.isRequired, required: React.PropTypes.string.isRequired, label: React.PropTypes.string.isRequired }, mixins: [AlertMixin], getInitialState() { return { value: null, alerts: null // needed in AlertMixin }; }, handleChange(event) { this.setState({value: event.target.value}); }, render() { let alerts = (this.props.submitted) ? null : this.state.alerts; return (
{alerts}
); } }); export default InputCheckbox;