question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
erikrascommented, Jul 8, 2019

Great sandbox, btw. It helps immensely in understanding what a lib consumer is trying to do. 👍

2reactions
erikrascommented, Jul 8, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found