formik
#
Installation#
API#
EnhancedFormik / useEnhancedFormikThese wrappers do a few things:
- handle reporting errors to Sentry
- adds
initialStatus
for form errors - adds
setFormSuccess
andsetFormError
helpers - adds
applyErrorsToFields
helper
#
EnhancedFormik#
useEnhancedFormik#
setFormSuccess / setFormErrorNote that setFormError accepts a sentryEventId
as the second property, which will be available on
form status.
You can use Sentry.showReportDialog(status.sentryEventId)
to show a report error dialog to the
user.
#
applyErrorsToFieldsapplyErrorsToFields
also accept a second optional argument of form { mapFieldName }
. It is a
function used when the FE and BE field names don't match.
#
EnhancedField / useEnhancedFieldEnhancement that allows you to hide field errors when the input gains focus. It does this by setting
meta.touched
to false
.