Created
March 6, 2018 12:24
-
-
Save hpstuff/e92c6c8b3e9acc6de8ab47f96c476ac9 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
//let stepOptions = options.slice(0, options.length); | |
let stepOptions = options.map(({title}, i) => { title, index: [i] }); | |
stepOptions.splice(1, 0, { title: 'Best of Both', index: [0, 1] }); | |
{stepOptions.map((({title, index}), i) => <CheckBox label={title} key={i} value={this.isSelected(index)} onChange={() => onChange(index)} />)} | |
isSelected(index) { | |
const { value } = this.props; | |
return value === index; | |
} | |
value = [1], [0,1], [0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment