Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (20 sloc) 891 Bytes

FormProvider

Specification

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

Props

Prop name Type Default value Description
rules ValidationSchema undefined Validation rules schema.
messages [ValidationMessages: Object] 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):

import React from 'react'
import { FormProvider } from 'react-advanced-form'

const App = ({ children }) => (
  <FormProvider rules={validationRules} messages={validationMessages}>
    {children}
  </FormProvider>
)