Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit be45d1a

Browse files
author
Anthony Shuker
authored
Fix "Sync Validation" example
Fixes "Sync Validation" example which compares the code to redux-form
1 parent 387d77a commit be45d1a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/guides/compare-redux-form.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,19 @@ import { Form, Control, Errors } from 'react-redux-form';
160160
const required = (val) => !!(val && val.length);
161161

162162
const SyncValidationForm = () => (
163-
<Form model="syncValidation" onSubmit={...}>
163+
<Form model="syncValidation" onSubmit={(vals) => console.log(vals)}>
164164
<div>
165165
<label>Username</label>
166166
<Control.text
167167
placeholder="Username"
168168
validators={{ required }}
169+
model=".username"
170+
/>
171+
<Errors
172+
model="syncValidation.username"
173+
messages={{ required: 'Required' }}
174+
show="touched"
169175
/>
170-
<Errors messages={{ required: 'Required' }} />
171176
</div>
172177
</Form>
173178
);

0 commit comments

Comments
 (0)