Added sanitizeError method to ErrorAlerts
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}
/>
);