[v7] Material UI Multiple Checkboxes with useController #4801
-
I am trying to figure out a way to create a reusable form component, that would utilize useController and the standard Material UI Checkbox, that I can pass it an array of objects, and have it save my results in array. this is what I expect it to look like This is my Sample data, and what i would love to happen is when I click on a few checkboxes it saves the values in an array. so i was thinking something along these lines Update... i fixed my link, and I came up with a solution, but if you have a better one I am all ears |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Your solution looks good to me, you want to share the link in a comment and i will vote as an answer? https://codesandbox.io/s/festive-grothendieck-thfhh?file=/src/App.js (i will update yours as answer once your comment i up there) |
Beta Was this translation helpful? Give feedback.
-
Here is a codesandbox of a way I got this to work https://codesandbox.io/s/festive-grothendieck-thfhh?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
-
well... this is unfortunate. I was cleaning out my CodeSandboxes as I had like 200 random ones and accidentally deleted this one... Here is a snip of my current reusable checkbox group code,
|
Beta Was this translation helpful? Give feedback.
Here is a codesandbox of a way I got this to work
https://codesandbox.io/s/festive-grothendieck-thfhh?file=/src/App.js