You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Form` component will accept the following props:
162
162
163
-
* name (string, required) - The name of the form.
164
-
* render (component/function, required) - Function/functional component that will render the form - passed InjectedFormProps as below
165
-
* renderProps (object, optional) - Custom props to pass to the render component
166
-
* validators (object, optional) - Form validation object - see validation
167
-
* initialValues (object, optional) - Initial form values in the form `{ [fieldName]: value }`
168
-
* onSubmit (function, optional) - Called on form submission with form values. Should return void or Promise<void>
169
-
* onSubmitFailed (function, optional) - Called when submission fails due to validation errors, with form values. Should return void or Promise<void>
170
-
* onChange (function, optional) - Called when any form value changes, with all form values
163
+
*name (string, required) - The name of the form.
164
+
*render (component/function, required) - Function/functional component that will render the form - passed InjectedFormProps as below
165
+
*renderProps (object, optional) - Custom props to pass to the render component
166
+
*validators (object, optional) - Form validation object - see validation
167
+
*initialValues (object, optional) - Initial form values in the form `{ [fieldName]: value }`
168
+
*onSubmit (function, optional) - Called on form submission with form values. Should return void or Promise<void>
169
+
*onSubmitFailed (function, optional) - Called when submission fails due to validation errors, with form values. Should return void or Promise<void>
170
+
*onChange (function, optional) - Called when any form value changes, with all form values
171
171
172
172
The render component you provide will receive the following props:
173
173
174
-
* Field (Component) - A component to create fields
175
-
* form (object) - Props that must be passed to a <form> element
176
-
* values (object) - Current form values
177
-
* meta (object)
178
-
* valid (boolean) - Is validation currently passing
179
-
* submitted (boolean) - Has the form been submitted at any time
180
-
* errors: (object) - Current errors for the form, { [fieldName]: { error: string }}
181
-
* isValidating (boolean) - Is validation currently ongoing
182
-
* isSubmitting (boolean) - Is submission currently ongoing
183
-
* actions (object)
184
-
* reset (function) - Call to reset the form to initial values and clear validation errors
185
-
* submit: (function) - Call to submit the form
186
-
* ownProps (object) - Any additional props passed via `renderProps` above
174
+
*Field (Component) - A component to create fields
175
+
*form (object) - Props that must be passed to a <form> element
176
+
*values (object) - Current form values
177
+
*meta (object)
178
+
*valid (boolean) - Is validation currently passing
179
+
*submitted (boolean) - Has the form been submitted at any time
180
+
*errors: (object) - Current errors for the form, { [fieldName]: { error: string }}
181
+
*isValidating (boolean) - Is validation currently ongoing
182
+
*isSubmitting (boolean) - Is submission currently ongoing
183
+
*actions (object)
184
+
*reset (function) - Call to reset the form to initial values and clear validation errors
185
+
*submit: (function) - Call to submit the form
186
+
*ownProps (object) - Any additional props passed via `renderProps` above
187
187
188
188
### Field
189
189
190
190
The `Field` component (as provided to the `Form` renderer), can be passed the following props:
191
191
192
-
* name (string, required) - The field name
193
-
* render (component/function, required) - Field renderer - passed InjectedFieldProps as below
194
-
* renderProps (object, optional) - Custom props to pass to the field renderer
195
-
* onChange (function, optional) - Called with the change event, and the field value, whenever the field value changes I.e. (e: SyntheticEvent, value: string | number | undefined) => void
196
-
* onFocus (function, optional) - Called with the focus event, and the field value, whenever the field value is focused
197
-
* onBlur (function, optional) - Called with the blur event, and the field value, whenever the field value is blurred
192
+
*name (string, required) - The field name
193
+
*render (component/function, required) - Field renderer - passed InjectedFieldProps as below
194
+
*renderProps (object, optional) - Custom props to pass to the field renderer
195
+
*onChange (function, optional) - Called with the change event, and the field value, whenever the field value changes I.e. (e: SyntheticEvent, value: string | number | undefined) => void
196
+
*onFocus (function, optional) - Called with the focus event, and the field value, whenever the field value is focused
197
+
*onBlur (function, optional) - Called with the blur event, and the field value, whenever the field value is blurred
198
198
199
199
The render component passed to `Field` is provided with the following props. The input prop should generally be passed directly to the underlying <input> element, i.e. <input {...input} />
200
200
201
-
* meta (object)
202
-
* valid (boolean) - Does the field pass validation
203
-
* error (string | undefined) - Current validation error
204
-
* pristine (boolean) - True if the field has the same value as its initial value
205
-
* touched (boolean) - Has the field has ever been focused
206
-
* active (boolean) - Is the field currently focused
207
-
* isValidating (boolean) - Is the field currently being validated
208
-
* input (object)
209
-
* onChange (function) - Called with (event, value) when the field value changes
210
-
* onFocus (function) - Called with (event, value) when the field is focused
211
-
* onBlur (function) - Called with (event, value) when the field is blurred
212
-
* value (string | number | undefined) - Current field value
213
-
* name (string) - Name of the field
214
-
* ownProps - Any custom props passed to `Field`s `renderProps`
201
+
*meta (object)
202
+
*valid (boolean) - Does the field pass validation
203
+
*error (string | undefined) - Current validation error
204
+
*pristine (boolean) - True if the field has the same value as its initial value
205
+
*touched (boolean) - Has the field has ever been focused
206
+
*active (boolean) - Is the field currently focused
207
+
*isValidating (boolean) - Is the field currently being validated
208
+
*input (object)
209
+
*onChange (function) - Called with (event, value) when the field value changes
210
+
*onFocus (function) - Called with (event, value) when the field is focused
211
+
*onBlur (function) - Called with (event, value) when the field is blurred
212
+
*value (string | number | undefined) - Current field value
213
+
*name (string) - Name of the field
214
+
*ownProps - Any custom props passed to `Field`s `renderProps`
0 commit comments