React-final-form: How to handle radio buttons in react-final-form?

Created on 3 Jul 2019  路  5Comments  路  Source: final-form/react-final-form

Are you submitting a bug report or a feature request?

Bug Report

What is the current behavior?

I am not getting the radio input value when the Field type is radio. I am not even sure if this is the correct way to handle radio inputs using RFF.

What is the expected behavior?

I should receive value in the input prop to set the checked value on the radio inputs.

Sandbox Link

https://codesandbox.io/s/nostalgic-tdd-vy2r1

What's your environment?

Latest of both libs and Chrome 75 on Windows 10.

Most helpful comment

The library does all that for you. (See Simple Example) Handling it yourself is _possible_, but complicated. If you use one Field component per radio button, with the value prop, things will get a lot easier. When you use type="radio", RFF generates a checked boolean for you.

Edit kind-sky-pqoot

All 5 comments

The library does all that for you. (See Simple Example) Handling it yourself is _possible_, but complicated. If you use one Field component per radio button, with the value prop, things will get a lot easier. When you use type="radio", RFF generates a checked boolean for you.

Edit kind-sky-pqoot

Great sandbox, btw. It helps _immensely_ in understanding what a lib consumer is trying to do. 馃憤

could anyone point me to the simple example? its gone again

This should be in the documentation: https://codesandbox.io/s/kind-sky-pqoot?fontsize=14

Was this page helpful?
0 / 5 - 0 ratings