diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index 851227dd6ad..32769902670 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -1335,7 +1335,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 () => {