form.setFieldValue with field array
I have a form defined like this:
I am trying to update a field in the ingredients array (stored as a temporary value when editing it, so I can revert to the previous state if the user cancels the edit):
When doing this I get the following TypeScript error:
Why can't the
setFieldValue()
detect that is a proper key? Is there a better way to revert the value at the specific index to the previous state?3 Replies
fascinating-indigoOP•8mo ago
@crutchcorn sorry for the tag but any ideas here?
fair-rose•8mo ago
It might be that
useForm
shouldn't accept a generic; it'll cause bugs in the future if not this bug itself
Our docs have a few useForm<>
usages that we're removing soonfascinating-indigoOP•8mo ago
Awesome, thank you for the quick response! Will give that a shot