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 } }