From d2c6edacb6464b52513dbe467c8b5713abd6a9fc Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 28 Feb 2024 13:27:54 -0600 Subject: Protect against non functions being passed to close callback (#3019) --- src/components/Dialog/types.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/components/Dialog/types.ts') diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index 75ba825ac..161c03734 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -6,8 +6,13 @@ import {ViewStyleProp} from '#/alf' type A11yProps = Required +export type DialogControlProps = { + open: (options?: DialogControlOpenOptions) => void + close: (callback?: () => void) => void +} + export type DialogContextProps = { - close: () => void + close: DialogControlProps['close'] } export type DialogControlOpenOptions = { @@ -20,11 +25,6 @@ export type DialogControlOpenOptions = { index?: number } -export type DialogControlProps = { - open: (options?: DialogControlOpenOptions) => void - close: (callback?: () => void) => void -} - export type DialogOuterProps = { control: { ref: React.RefObject -- cgit 1.4.1