Created
November 30, 2018 10:19
-
-
Save blizzerand/4a27631c232c96eae1ebfeb68bd0be20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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