Answer the question
In order to leave comments, you need to log in
How to create a radio-button group in Formik?
I do user registration using Formik.
I googled how to make the button radio shape, but there is a problem.
export default function RadioButton({ options }) {
return (
<Field component="div">
{
options.map((option, index) => {
return (
<div className="radio" key={ index }>
<input
type="radio"
id={ option.id }
value={ option.value }
/>
<label htmlFor={option.id}>{option.key}</label>
</div>
)
})
}
</Field>
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question