Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ should change the heading of the (upcoming) version to include a major version b

- Updated docs for ArrayFieldItemTemplate to include prop `onCopyIndexClick`, fixing [#4507](https://github.com/rjsf-team/react-jsonschema-form/issues/4507)
- Use antd 5 in playground
- Updated docs to clarify that errors raised within a widget are not caught during form validation

# 5.24.8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ The default widgets you can override are:

## Raising errors from within a custom widget or field

You can raise a custom error by overriding the `onChange` method to raise field/widget errors:
You can raise custom 'live validation' errors by overriding the `onChange` method to provide feedback while users are actively changing the form data.
Note that these errors are temporary and are not recognized during the form validation process.

:::warning

This method of raising errors _only_ runs during `onChange`, i.e. when the user is changing data. This will not catch errors `onSubmit`, i.e when submitting the form.
If you wish to add generic validation logic for your component, you should use the [`customValidate` Form prop](../api-reference/form-props.md#customvalidate).

:::

```tsx
import { ErrorSchema, RJSFSchema, UiSchema, WidgetProps, RegistryWidgetsType } from '@rjsf/utils';
Expand Down