Replies: 1 comment 2 replies
-
RHF uses const { fields } = useFieldArray({
keyName: "key"
})
return fields.map(field =>
// INFO: access the set `keyName` field value for the field's id instead
<input key={field.key} />
) This will result in your field array data set having the your initial data id field on substitution |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I have this selection where the user can choose a product. Each product has a an ID. Is it possible to also save the product ID when I submit this?
I have recreated this in codesandbox as well: https://codesandbox.io/s/react-hook-form-wizard-form-from-reddit-with-data-ouy64e?file=/src/fieldArray.js:772-957
Data:
Beta Was this translation helpful? Give feedback.
All reactions