Skip to content

Instantly share code, notes, and snippets.

@blizzerand
Created November 30, 2018 10:19
Show Gist options
  • Save blizzerand/4a27631c232c96eae1ebfeb68bd0be20 to your computer and use it in GitHub Desktop.
Save blizzerand/4a27631c232c96eae1ebfeb68bd0be20 to your computer and use it in GitHub Desktop.
const CheckBox = (props) => {
return( <div>
<label for={props.name} className="form-label">{props.title}</label>
<div className="checkbox-group">
{props.options.map(option => {
return (
<label key={option}>
<input
className="form-checkbox"
id = {props.name}
name={props.name}
onChange={props.handleChange}
value={option}
checked={ props.selectedOptions.indexOf(option) > -1 }
type="checkbox" /> {option}
</label>
);
})}
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment