diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index 721e5a49ae3..2909be59ca6 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -1252,7 +1252,7 @@ function isInputElement(object: any): object is HTMLInputElement { * * @see https://remix.run/api/remix#usebeforeunload */ -export function useBeforeUnload(callback: () => any): void { +export function useBeforeUnload(callback: (event: BeforeUnloadEvent) => any): void { React.useEffect(() => { window.addEventListener("beforeunload", callback); return () => {