diff --git a/packages/@mantine/modals/src/ModalsProvider.tsx b/packages/@mantine/modals/src/ModalsProvider.tsx index 00cc88966a..37a89e08d9 100644 --- a/packages/@mantine/modals/src/ModalsProvider.tsx +++ b/packages/@mantine/modals/src/ModalsProvider.tsx @@ -166,7 +166,7 @@ export function ModalsProvider({ children, modalProps, labels, modals }: ModalsP }); const ctx: ModalsContextProps = { - modalProps, + modalProps: modalProps || {}, modals: state.modals, openModal, openConfirmModal, diff --git a/packages/@mantine/modals/src/context.ts b/packages/@mantine/modals/src/context.ts index 8cb6898349..0ceb7242e9 100644 --- a/packages/@mantine/modals/src/context.ts +++ b/packages/@mantine/modals/src/context.ts @@ -24,7 +24,7 @@ export type ModalState = | { id: string; props: OpenContextModal; type: 'context'; ctx: string }; export interface ModalsContextProps { - modalProps?: ModalSettings, + modalProps: ModalSettings, modals: ModalState[]; openModal: (props: ModalSettings) => string; openConfirmModal: (props: OpenConfirmModal) => string;