Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): add info on transformErrors #45

Merged
merged 1 commit into from
May 27, 2024
Merged
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ const transformSchema = (schema) => {
<FormuleContext transformSchema={transformSchema}>// ...</FormuleContext>;
```

### Handling and customizing errors

You can add a custom `transformErrors` function to process, edit or filter the errors from RJSF in the way that best suits our needs:

```jsx
const transformErrors = (errors) => {
return errors.filter(...)
};

<FormuleForm transformErrors={transformErrors} />
```

### Syncing Formule state

If you want to run some logic in your application every time the current Formule state changes in any way (e.g. to run some action every time a new field is added to the form) you can pass a function to be called back when that happens:
Expand Down
Loading