UNPKG

rstarter-supporthq

Version:

14 lines 524 B
import React, {Fragment} from 'react'; const RadioInputList=(props)=>{ const gpPrefix="RGp"+Math.random().toString(36).substring(7); return <Fragment> {props.Items.map((item,index)=>{ return <label key={gpPrefix+index} style={{marginLeft:"1rem"}}><input type="radio" onChange={(e)=>{ props.onChange(e.target.value); } } name={gpPrefix} value={item.value}/> {item.label}</label> }) } </Fragment> } export default RadioInputList;