How to force a dynamic checkbox group to always return a list on submit #3693
-
I have a dynamic group of checkboxes in a form Example <form>
{listOfStuff.map(thing => <input type="checkbox" name="stuff" value={thing.name} />
</form> I want to handle this data as an array, but if I only render one checkbox ( |
Beta Was this translation helpful? Give feedback.
Answered by
bluebill1049
Dec 15, 2020
Replies: 1 comment 1 reply
-
I think it's probably easier to build a controlled input and wrapped with |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
GV94
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it's probably easier to build a controlled input and wrapped with
Controller
, then you can easier to manage your data type.