react-jsonschema-form
react-jsonschema-form copied to clipboard
Pass errorSchema from ArrayField to ArrayFieldTemplate
Prerequisites
- [X] I have read the documentation
What theme are you using?
core
Is your feature request related to a problem? Please describe.
I would like to show errors inside a custom ArrayFieldTemplate, but rawErrors is undefined and the template does not get the errorSchema from the ArrayField
Describe the solution you'd like
Passing the errorSchema from ArrayField to ArrayFieldTemplate would solve this for me. However, it is not quite clear to me why the rawErrors prop is undefined. The template will contain objects, so that might be the reason?
Describe alternatives you've considered
No response
@vstenvik The rawErrors array represents the errors for only that level in the hierarchy and not below. Passing through the errorSchema as an optional field makes sense (in order to maintain backwards compatibility). If you are willing to provide a fix, update the ArrayFieldTemplateProps in @rjsf/utils, the documentation as well as the ArrayField implementation in @rjsf/core
Thanks!
@heath-freenome thanks, that makes sense! I'll try to provide a PR shortly.