Skip to content

Instantly share code, notes, and snippets.

@nackjicholson
Created January 14, 2016 19:11
Show Gist options
  • Select an option

  • Save nackjicholson/feba56275f5e5b1bc4ed to your computer and use it in GitHub Desktop.

Select an option

Save nackjicholson/feba56275f5e5b1bc4ed to your computer and use it in GitHub Desktop.
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