Sha256: 43c8e68f29126cf15060d4e09222250711fc4e87ecdb44f012af571561a3a416
Contents?: true
Size: 1.38 KB
Versions: 1919
Compression:
Stored size: 1.38 KB
Contents
import React, { useState } from 'react' import Radio from '../_radio' const RadioCustom = (props) => { const [choice, setChoice] = useState('power') const handleOnChange = ({ target }) => { setChoice(target.value) } return ( <div> <p> {'Your choice is: '} <code>{choice}</code> </p> <br /> <Radio className="my_custom_class" label="Custom Power" {...props} > <input checked={choice === 'power'} name="custom" onChange={handleOnChange} type="radio" value="power" {...props} /> </Radio> <br /> <Radio className="my_custom_class" label="Custom Nitro" {...props} > <input checked={choice === 'nitro'} name="custom" onChange={handleOnChange} type="radio" value="nitro" {...props} /> </Radio> <br /> <Radio className="my_custom_class" label="Custom Google" {...props} > <input checked={choice === 'google'} name="custom" onChange={handleOnChange} type="radio" value="google" {...props} /> </Radio> </div> ) } export default RadioCustom
Version data entries
1,919 entries across 1,919 versions & 2 rubygems