react-component / form

React High Order Form Component(web & react-native)
http://react-component.github.io/form/
MIT License
1.81k stars 296 forks source link

Problem with getting field errors at validateFieldsInternal method #363

Open alex-knyazev opened 4 years ago

alex-knyazev commented 4 years ago

https://github.com/react-component/form/blob/master/src/createBaseForm.js#L547

If we have array as a field value - we have an array in fieldErrors variables here, not an object with errors property.

But string below expects errors property in fieldErrors : https://github.com/react-component/form/blob/master/src/createBaseForm.js#L555

I also created related issue un antd-design:

https://github.com/ant-design/ant-design/issues/20878

Reproduction, where we can see the behaviour I've described

https://github.com/alex-knyazev/antd-validation-bug-reproduction

alex-knyazev commented 4 years ago

P.S.: I found solution only with using of async-validator lib and custom validator prop:

https://github.com/alex-knyazev/antd-validation-bug-reproduction/commit/f61be6fe316668c647769a1e89c2b2e26c4fbdd9