Skip to content

Instantly share code, notes, and snippets.

@prasanna1211
Created January 25, 2018 07:17
Show Gist options
  • Save prasanna1211/7f24c0a0cf3ae5fc7cbb6011a59f9fab to your computer and use it in GitHub Desktop.
Save prasanna1211/7f24c0a0cf3ae5fc7cbb6011a59f9fab to your computer and use it in GitHub Desktop.
const asyncValidate = (values) => { 
  // ... returns a promise which does the async operation of validating the field. 
}; 

const renderField = ({ meta }) => { 
  /* asyncValidating flag in field meta prop to know the status of ongoing async validating action */ 
  
  const { asyncValidating } = meta; // ... rendering of field 
}; 

//... return of HOC 
return reduxForm({ 
  asyncValidate, 
  /* option to specify the field of which "blurring" will trigger asyncValidate method */ 
  asyncBlurFields: ['userName'], 
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment