From 8825f1bc09c85dfacdc7251d51e3d63713f577ea Mon Sep 17 00:00:00 2001 From: Arthur Neuman Date: Thu, 6 Nov 2025 12:11:59 -0500 Subject: [PATCH] Use React.useCallback for useDialog Dialog component --- src/Modal/Modal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Modal/Modal.tsx b/src/Modal/Modal.tsx index 6b703ac1..2068f3f6 100644 --- a/src/Modal/Modal.tsx +++ b/src/Modal/Modal.tsx @@ -87,13 +87,13 @@ const useDialog = () => { dialogRef.current?.close() }, [dialogRef]) - const Dialog = ({ children, ...props }: DialogProps) => { + const Dialog = useCallback(({ children, ...props }: DialogProps) => { return ( {children} ) - } + }, [dialogRef]) Dialog.displayName = 'Dialog' return { dialogRef, Dialog, handleShow, handleHide } }