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
{{ message }}
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
Also, see [./validation.md](the validation guide) for more information.
60
+
59
61
### How do I get the component instance? `ref={...}` doesn't work.
60
62
61
63
Use `getRef={(node) => ...}` in place of `ref`. This is due to the fact that React treats the `ref` prop as a "magic" prop that doesn't get propagated down through wrapped components.
Suppose you are validating `'user.email'`. At any point, you can dispatch `actions.setValidity()` to set the validity of that model on your form state:
@@ -235,6 +302,28 @@ import { Form } from 'react-redux-form';
235
302
</Form>
236
303
```
237
304
305
+
## Validating across models
306
+
307
+
Any validation across models is best represented as a form-level validator. For instance, say you have a form where the two password fields, `.password` and `.confirmPassword`, need to match:
When any of the `user` model values change, the form-level validity will be updated. You can manually retrieve form-level validation by accessing `[form path].$form.validity`, which represents the validity of the entire form.
326
+
238
327
## Deep Model Validation in `<Form>`
239
328
240
329
As of RRF version 1.2.4, you can have deep validators in the `<Form validators={{...}}>` prop. Here's what it looks like:
0 commit comments