From 8d1ca91336bd9dcc9ed2de3b780a51c38f995a9f Mon Sep 17 00:00:00 2001 From: Austin Dase <59173272+adase11@users.noreply.github.com> Date: Sun, 6 Oct 2024 12:43:21 -0400 Subject: [PATCH] cleanup types --- src/components/Contact/EmailLink.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Contact/EmailLink.tsx b/src/components/Contact/EmailLink.tsx index 6326a5ea1..ec903cbd4 100644 --- a/src/components/Contact/EmailLink.tsx +++ b/src/components/Contact/EmailLink.tsx @@ -27,11 +27,10 @@ const messages = [ 'thanks', ]; -const useInterval = (callback, delay) => { - const savedCallback: React.MutableRefObject = useRef(); - if (!savedCallback) { - throw new Error(); - } +const useInterval = (callback: () => void, delay: number | null) => { + const savedCallback: React.MutableRefObject<() => void> = useRef<() => void>( + () => {} + ); useEffect(() => { savedCallback.current = callback;