Skip to content

Instantly share code, notes, and snippets.

@kettanaito
Last active April 22, 2018 10:44
Show Gist options
  • Save kettanaito/cfdd27fc96cfe8a1f3787cb5524f067e to your computer and use it in GitHub Desktop.
Save kettanaito/cfdd27fc96cfe8a1f3787cb5524f067e to your computer and use it in GitHub Desktop.
React Advanced Form - Reactive props
<Input
name="firstName"
required={({ get }) => {
// resolves any time "value" prop of "lastName" changes
return !!get(['lastName', 'value']);
}} />
<Input
name="lastName"
required={({ get }) => {
// resolves any time "value" prop of "firstName" changes
return !!get(['firstName', 'value']);
}} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment