Skip to content

Conversation

@gwhobbs
Copy link

@gwhobbs gwhobbs commented Jun 25, 2022

Sometimes it's helpful to be able to update form data manually. For example, maybe:

  • We might want changing one field to affect the values of other fields (e.g. an array of values that must add to 100)
  • We might want a button that causes predefined changes to happen to the form data (e.g. a button that alters existing items in an array)

This PR experimentally adds two new features addressing these issues:

  1. A custom onApplyChangeToForm(formData: FormData, fieldValue: any, fieldPath: string) => FormData updater function can be provided as an option in getInputProps()
  2. An updateFormData(formData: FormData) => void function is exposed for making arbitrary changes to the form data.

Closes #41

@gwhobbs gwhobbs changed the title Add methods to update form data manually (closes #41) Add methods to update form data manually Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant