Skip to content

Commit

Permalink
[Doc] Clarify <SaveButton transform> usage
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Jun 11, 2024
1 parent c2c7dbf commit fb383c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/SaveButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ const transformUser = data => ({

const UserCreateToolbar = () => (
<Toolbar>
<SaveButton transform={transformUser} />
<SaveButton type="button" transform={transformUser} />
</Toolbar>
);
```

**Tip:** You need to set `type="button"` on the `<SaveButton>` to use `transform`. Without it, the form would be submitted with the default `transform` from the main page.

## `type`

By default, `<SaveButton>` renders a `submit` button. You can change this by passing `type="button"`. It is especially useful when using more than one save button in a form:
Expand Down

0 comments on commit fb383c8

Please sign in to comment.