Skip to content

Commit a0b5741

Browse files
committed
Update validators docs examples.
1 parent 7019e0a commit a0b5741

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

packages/react-renderer-demo/src/app/pages/renderer/validators.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Grid from '@material-ui/core/Grid'
2-
import RawComponent from '@docs/raw-component';
2+
import CodeExample from '../../src/components/code-example';
33

44
import ListOfContents from '../../src/helpers/list-of-contents';
55

@@ -16,29 +16,29 @@ A item of the validate array can be:
1616

1717
## Required validator
1818

19-
<RawComponent source="validators/required-validator" />
19+
<CodeExample source="components/validators/required-validator" mode="preview" />
2020

2121
## Length validators
2222

23-
<RawComponent source="validators/length-validators" />
23+
<CodeExample mode="preview" source= "components/validators/length-validators" />
2424

2525
## Number value validators
2626

27-
<RawComponent source="validators/number-validator" />
27+
<CodeExample mode="preview" source= "components/validators/number-validator" />
2828

2929
## Pattern validators
3030

31-
<RawComponent source="validators/pattern-validator" />
31+
<CodeExample mode="preview" source= "components/validators/pattern-validator" />
3232

3333
## URL validators
3434

35-
<RawComponent source="validators/url-validator" />
35+
<CodeExample mode="preview" source= "components/validators/url-validator" />
3636

3737
## Custom function
3838

3939
As validator you can provide your custom function:
4040

41-
<RawComponent source="validators/custom-function" />
41+
<CodeExample mode="preview" source= "components/validators/custom-function" />
4242

4343
The function takes `value` as an argument and should return undefined when pasess or string as an error message when fails.
4444

@@ -48,7 +48,7 @@ You can use a Async function as a validator. But it **must be first in the valid
4848

4949
You can either use custom function, or custom validator from validator mapper.
5050

51-
<RawComponent source="validators/async-validator" />
51+
<CodeExample mode="preview" source= "components/validators/async-validator" />
5252

5353

5454
Validator inputs and results are being cached so you will get immediate feedback for recurring values before the validation is actually finished.
@@ -130,13 +130,13 @@ By providing `validateOnMount` the validation will be triggered immediately afte
130130
This form of validation enables you to create validation function for whole form. It is useful for some cross validation between multiple fields etc.
131131
Detailed information can be found [here](https://final-form.org/docs/react-final-form/examples/record-level-validation).
132132

133-
<RawComponent source="validators/record-level-validation" />
133+
<CodeExample mode="preview" source= "components/validators/record-level-validation" />
134134

135135
# Overwriting default messages
136136

137137
You can either specify message attribute while adding validator or override validation message of specific validator globally via Validators config.
138138

139-
<RawComponent source="validators/global-message" />
139+
<CodeExample mode="preview" source= "components/validators/global-message" />
140140

141141
</Grid>
142142
<Grid item xs={false} md={2}>

0 commit comments

Comments
 (0)