Skip to content

Added sanitizeError method to ErrorAlerts

Compare
Choose a tag to compare
@anru anru released this 22 Dec 10:50
· 43 commits to master since this release

Now you can do this:

function sanitizeError(err: string): string {
  if (err.startsWith('Items out of stock')) {
     return 'Unable to checkout — item is out of stock';
  }
}

return (
  <ErrorAlerts
    error={props.error}
    sanitizeError={sanitizeError}
  />
);