Created
January 14, 2016 19:11
-
-
Save nackjicholson/feba56275f5e5b1bc4ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| return function StatelessRadio({ baseId, defaultValue, titleText, inputs = [] } = {}) { | |
| // ... | |
| {inputs.map((inputItem) => { | |
| const defaultChecked = (defaultValue === inputItem.value); | |
| return ( | |
| <div> | |
| <input type="radio" name={baseId} value={inputItem.value} defaultChecked={defaultChecked} /> | |
| <label>{inputItem.label}</label> | |
| </div> | |
| ); | |
| })} | |
| // .... | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment