How to handle radio buttons in react-final-form?
See original GitHub issueAre 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React Final Form radio - CodeSandbox
import React from "react"; · import { render } from "react-dom"; · import { Form, Field } from "react-final-form"; · const Radio =...
Read more >Adding custom prop to RadioGroup field with React Final Form
1 Answer 1 ; FormControlLabel label ; "Ford" control ; { · Field ; name · "carPrice" ; component · {Radio} ...
Read more >Final Form Docs – `FieldProps`
If set to "checkbox" or "radio" , React Final Form will know to manage your values as a checkbox or radio button respectively....
Read more >How to Write Cactus Forms Using Final Form - GitHub Pages
Radio Buttons, Checkboxes & Toggles ... Even if you explicitly tell it which component to use, you also must pass the type prop...
Read more >How to Use Radio Buttons in ReactJS | Pluralsight
As you can see in the above example, in the form there are three different radio buttons along with the submit button, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great sandbox, btw. It helps immensely in understanding what a lib consumer is trying to do. 👍
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 thevalue
prop, things will get a lot easier. When you usetype="radio"
, RFF generates achecked
boolean for you.