# FormProvider

## Specification

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

## Props

| Prop name      | Type                                                                          | Default value | Description                                                    |
| -------------- | ----------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------- |
| `rules`        | [ValidationSchema](/react-advanced-form/validation/schema.md)                 | `undefined`   | Validation rules schema.                                       |
| `messages`     | [`[ValidationMessages: Object]`](/react-advanced-form/validation/messages.md) | `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):

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://redd.gitbook.io/react-advanced-form/components/form-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
