diff --git a/docs/SaveButton.md b/docs/SaveButton.md index 656ebf07289..9cb623a6fb7 100644 --- a/docs/SaveButton.md +++ b/docs/SaveButton.md @@ -21,11 +21,13 @@ import { SaveButton, Toolbar, Edit, SimpleForm, useNotify, useRedirect } from 'r const PostSaveButton = props => { const notify = useNotify(); const redirect = useRedirect(); - const onSuccess = (response) => { - notify(`Post "${response.data.title}" saved!`); + const onSuccess = data => { + notify(`Post "${data.title}" saved!`); redirect('/posts'); }; - return <SaveButton {...props} mutationOptions={{ onSuccess }} />; + return ( + <SaveButton {...props} type="button" mutationOptions={{ onSuccess }} /> + ); }; const PostEditToolbar = () => (