Skip to content

Instantly share code, notes, and snippets.

@kettanaito
Last active February 11, 2019 21:28
Show Gist options
  • Save kettanaito/17b0640cb2a9cdaab279026e51993500 to your computer and use it in GitHub Desktop.
Save kettanaito/17b0640cb2a9cdaab279026e51993500 to your computer and use it in GitHub Desktop.
React Advanced Form - Validation messages (async)
// src/validation-messages.js
export default {
...
name: {
userEmail: {
async: ({ value, errorCode }) => {
return`E-mail "${email}" is already registered. Error code: ${errorCode}.`;
}
}
}
};
@redraushan
Copy link

redraushan commented Feb 11, 2019

Hi Artem, how does ${email} gets resolved? I don’t see it getting passed from params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment