rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
13.8k stars 2.16k forks source link

Feat: Allow raising errors from within a custom whatever(#2718) #4188

Open abdalla-rko opened 1 month ago

abdalla-rko commented 1 month ago

Reasons for making this change

I introduced a raiseFieldErrors method to raise errors from within a custom component(see #2718).

The current behavior allows errors to be raised from custom components and when the form onChange is triggered, we clear the custom raised errors. I appreciate any feedback on this approach. If everything looks good, I'll write tests and implement this in other themes.

Checklist

heath-freenome commented 1 month ago

@abdalla-rko If the goal is to update the errorSchema via a custom widget, maybe it makes sense to update the onChange in WidgetProps to function similarly to the onChange in FieldProps, where the errorSchema can be updated as it is flows through the schema hierarchy. Feel free to join the next meeting so we can talk about it. Or reach out to me on Discord