Skip to content

Instantly share code, notes, and snippets.

@nackjicholson
Created January 14, 2016 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nackjicholson/b08e98bdc20477aa336d to your computer and use it in GitHub Desktop.
Save nackjicholson/b08e98bdc20477aa336d to your computer and use it in GitHub Desktop.
export default function statelessRadio(React) {
return function StatelessRadio({ baseId, titleText, inputs = [] } = {}) {
return (
<div id={baseId}>
<p id={`${baseId}__title`}>{titleText}</p>
{inputs.map((inputItem) => {
return (
<div>
<input name={baseId} value={inputItem.value} />
<label>{inputItem.label}</label>
</div>
);
})}
</div>
);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment