FormProvider

Specification

A provider component that propagates application-wide form settings to all children forms.

Props

Prop name
Type
Default value
Description
rules
undefined
Validation rules schema.
messages
unedfined
Validation messages.
debounceTime
number
250
Custom debounce duration (ms) for onChange field validation.

Example

Render the <FormProvider> on the root-level of your application (alongside the other providers you may have):
1
import React from 'react'
2
import { FormProvider } from 'react-advanced-form'
3
4
const App = ({ children }) => (
5
<FormProvider rules={validationRules} messages={validationMessages}>
6
{children}
7
</FormProvider>
8
)
Copied!
Last modified 3yr ago
Copy link