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
|[componentMapper](/mappers/custom-mapper)|object|Defines types of form field components. Field components can change the state of the form.|
25
-
|[FormTemplate](/components/form-template)|Component|Components which defines a template of the form. This component receives two props from the renderer: `formFields` and `schema`. `formFields` is the content of the form. You should wrap this content into your `<form>` component and add form buttons.|
26
-
|onSubmit|func|A submit callback which receives two arguments: `values` and `formApi`.|
27
-
|schema|object|A schema which defines structure of the form.|
22
+
### componentMapper
28
23
29
-
## Optional props
24
+
*object*
25
+
26
+
Defines types of form field components. Field components can change the state of the form.
27
+
28
+
You can use [globally defined attributes](/mappers/global-component-props).
29
+
30
+
[Read more](/mappers/custom-mapper).
31
+
32
+
---
33
+
34
+
### FormTemplate
35
+
36
+
*Component*
37
+
38
+
Components which defines a template of the form. This component receives two props from the renderer: `formFields` and `schema`. `formFields` is the content of the form. You should wrap this content into your `<form>` component and add form buttons.
39
+
40
+
[Read more](/components/form-template).
41
+
42
+
---
30
43
31
-
|Prop|Type|Description|Default|
32
-
|----|:--:|----------:|------:|
33
-
|[actionMapper](/mappers/action-mapper)|object|Action mapper allows to map props to functions.||
34
-
|[clearOnUnmount](/schema/clear-on-unmount)|bool|Will clear values of unmounted components. You can also set this to specific component in the form schema.|false|
35
-
|[clearedValue](/schema/cleared-value)|any|Value that will be set to field with **initialValue** after deleting it. Useful for forms while editing.|undefined|
36
-
|onReset|func|A reset callback. You don't need to manually clear the form values!||
37
-
|onCancel|func|A cancel callback, which receives `values` as the first argument.||
38
-
|debug|func|A function which will be called with every form update, i.e. `({ values }) => setValues(values)`, please take a look [here](https://final-form.org/docs/react-final-form/types/FormProps#debug)||
39
-
|initialValues|object|An object of fields names as keys and values as their values.||
40
-
|[schemaValidatorMapper](/mappers/schema-validator-mapper)|object|Schema validators mapper. You can control schemas of your components, validators and actions.||
41
-
|subscription|object|You can pass your own [subscription](https://final-form.org/docs/react-final-form/types/FormProps#subscription), which will be added to default settings.|`{ pristine: true, submitting: true, valid: true }`|
42
-
|[validate](/schema/introduction#validate)|func|A function which receives all form values and returns an object with errors.||
43
-
|[validatorMapper](/mappers/validator-mapper)|object|A mapper containing custom validators, it's automatically merged with the default one.||
Schema validators mapper. You can control schemas of your components, validators and actions.
153
+
154
+
[Read more](/mappers/schema-validator-mapper).
155
+
156
+
---
157
+
158
+
### subscription
159
+
160
+
*object*
161
+
162
+
You can pass your own [subscription](https://final-form.org/docs/react-final-form/types/FormProps#subscription), which will be added to default settings.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/examples/resolve-props-example.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To achieve that you need to rerender the changing field on each form change. Tha
11
11
12
12
## Subscription example
13
13
14
-
Using [subscription](/components/renderer#optionalprops) is a simple way how to let form to be rerendered each time values changed. However, this solution can bring a performance hit when used in large forms with tens of fields.
14
+
Using [subscription](/components/renderer##subscription) is a simple way how to let form to be rerendered each time values changed. However, this solution can bring a performance hit when used in large forms with tens of fields.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/mappers/action-mapper.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ import DocPage from '@docs/doc-page';
5
5
6
6
# Action Mapper
7
7
8
-
The [ActionMapper](/components/renderer#optionalprops) allows you to map schema props to functions. This is useful when your schema is not written in JavaScript and you cannot use function inside of it, especially for schemas stored in databases.
8
+
The [ActionMapper](/components/renderer#actionmapper) allows you to map schema props to functions. This is useful when your schema is not written in JavaScript and you cannot use function inside of it, especially for schemas stored in databases.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/mappers/schema-validator-mapper.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ import CodeExample from '@docs/code-example';
5
5
6
6
# Schema validation
7
7
8
-
Data Driven Forms contains default schema validator, that controls basic schema attributes: `name`, `component`, conditions, validators, etc. If you want to control your own validators, components or actions, use [schemaValidatorMapper](/components/renderer#optionalprops) prop.
8
+
Data Driven Forms contains default schema validator, that controls basic schema attributes: `name`, `component`, conditions, validators, etc. If you want to control your own validators, components or actions, use [schemaValidatorMapper](/components/renderer#schemavalidatormapper) prop.
9
9
10
10
It's a simple object containing three keys: `components`, `actions`, `validators`. Each of these is an another object with names as keys and functions as returns. Components' validators receive the whole field object, actions'/validators' validators receive two arguments: action/validator as the first one and the name of the field as the second one.
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/schema/resolve-props.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ const componentMapper = {
62
62
63
63
## Change props according to state of other components
64
64
65
-
You can get states of all other fields in the form via functions from `formOptions`. Don't forget to set the right [subscription](/components/renderer#optionalprops) to trigger `resolveProps` functions from changing other fields.
65
+
You can get states of all other fields in the form via functions from `formOptions`. Don't forget to set the right [subscription](/components/renderer#subscription) to trigger `resolveProps` functions from changing other fields.
0 commit comments