final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.39k stars 481 forks source link

Use FieldConfig.isEqual to determine if radio button is checked #324

Open kristinlindquist opened 6 years ago

kristinlindquist commented 6 years ago

Are you submitting a bug report or a feature request?

A wee little feature request

What is the current behavior?

The documentation says: "The radio button will render as checked if and only if the value given here === the value for the field in the form."

Is it reasonable to have FieldConfig.isEqual used instead of "===", when present? I'm storing an object as the radio input value and would like to set the equality comparison to (a, b) => { return (a.id === b.id); }

What's your environment?

"final-form": "^4.10.0", "react-final-form": "^3.6.5"

Other information

<3 react-final-form!

kg-currenxie commented 4 years ago

Was searching exactly for this! Radio button + object Haven't figured out how to yet. Did you manage to solve it?