Skip to content

Commit 6364076

Browse files
authored
Merge pull request #11077 from devserkan/master
fix(BulkDeleteWithConfirmButton): prevent mutationOptions from being passed to DOM
2 parents d922835 + 84630df commit 6364076

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const BulkDeleteWithConfirmButton = (
3434
icon = defaultIcon,
3535
label = 'ra.action.delete',
3636
mutationMode = 'pessimistic',
37+
mutationOptions,
3738
onClick,
3839
...rest
3940
} = props;
@@ -42,13 +43,13 @@ export const BulkDeleteWithConfirmButton = (
4243
mutationMode,
4344
...rest,
4445
mutationOptions: {
45-
...rest.mutationOptions,
46+
...mutationOptions,
4647
onSettled(...args) {
4748
// In pessimistic mode, we wait for the mutation to be completed (either successfully or with an error) before closing
4849
if (mutationMode === 'pessimistic') {
4950
setOpen(false);
5051
}
51-
rest.mutationOptions?.onSettled?.(...args);
52+
mutationOptions?.onSettled?.(...args);
5253
},
5354
},
5455
});
@@ -139,6 +140,7 @@ const sanitizeRestProps = ({
139140
label,
140141
resource,
141142
successMessage,
143+
mutationOptions,
142144
...rest
143145
}: Omit<BulkDeleteWithConfirmButtonProps, 'icon' | 'mutationMode'>) => rest;
144146

0 commit comments

Comments
 (0)