From 5020fa4c3b8099f37abb8165f0428c12d5b769bb Mon Sep 17 00:00:00 2001 From: LimeLine <43731728+Runner-dev@users.noreply.github.com> Date: Fri, 28 Oct 2022 18:29:03 -0300 Subject: [PATCH] fix(remix-react): add event type to `useBeforeUnload` (#1723) --- packages/remix-react/components.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 () => {