obss
logo
github_iconnpm_iconVersion: 5.0.2
ReactValidatableFormProvider
<ReactValidatableFormProvider lang={lang} customRules={customRules} translations={translations} dateFormatterFunction={dateFormatterFunction} dateWithTimeFormatterFunction={dateWithTimeFormatterFunction} hideBeforeSubmit={hideBeforeSubmit} showAfterBlur={showAfterBlur} focusToErrorAfterSubmit={focusToErrorAfterSubmit} elementFocusHandler={elementFocusHandler} > <App /> </ReactValidatableFormProvider>
Provider Parameters
See Example Usages
lang (string)
Selected language to show validation errors.
customRules (object)
Custom rules that are specific to app and that can used at any component wrapped by the provider.
translations (object)
Custom translation objects to override default error messages or to add a new language for error messages.
dateFormatterFunction (function)
Function that is used to format dates used in date rule without withTime option.
dateWithTimeFormatterFunction (function)
Function that is used to format dates used in date rule with withTime option.
hideBeforeSubmit (boolean)
Flag to hide validation errors before setFormIsSubmitted function is called.
showAfterBlur (boolean)
Flag to hide validation errors before setPathIsBlurred function is called for any path.
focusToErrorAfterSubmit (boolean)
Flag to automatically focus to first HTML element with validation error after setFormIsSubmitted function is called.
elementFocusHandler (function)
Function that accepts the first "elementId" of current validation errors as parameter that is used to customly manage DOM after submit.