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
foreign-sapphireOP•11mo ago
@crutchcorn sorry for the tag but any ideas here?
rare-sapphire•11mo 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 soonforeign-sapphireOP•11mo ago
Awesome, thank you for the quick response! Will give that a shot