Merge pull request #2162 from Neobii/newArrayValidationMessage

fixed nested array field error
This commit is contained in:
Sacha Greif 2018-12-26 13:20:23 +09:00 committed by GitHub
commit 283320c754
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,8 @@ const FormError = ({ error, errorContext, getLabel }) => {
if (error.message) { if (error.message) {
return error.message; return error.message;
} }
// in case this is a nested fields, only keep last segment of path
const errorName = error.properties.name.split('.').slice(-1)[0];
return ( return (
<FormattedMessage <FormattedMessage
id={error.id} id={error.id}