diff --git a/packages/@mantine/modals/src/ModalsProvider.tsx b/packages/@mantine/modals/src/ModalsProvider.tsx index 37a89e08d9..a594cc2633 100644 --- a/packages/@mantine/modals/src/ModalsProvider.tsx +++ b/packages/@mantine/modals/src/ModalsProvider.tsx @@ -148,8 +148,8 @@ export function ModalsProvider({ children, modalProps, labels, modals }: ModalsP ); const updateContextModal = useCallback( - (payload: { modalId: string } & Partial>) => { - dispatch({ type: 'UPDATE', modalId: payload.modalId, newProps: payload }); + ({ modalId, ...newProps }: { modalId: string } & Partial>) => { + dispatch({ type: 'UPDATE', modalId, newProps }); }, [dispatch] );