From 37e9ae0490ce96e8e83433584fa2f48750d177ec Mon Sep 17 00:00:00 2001 From: LimeLine <43731728+Runner-dev@users.noreply.github.com> Date: Sat, 29 Jan 2022 21:57:32 -0700 Subject: [PATCH 1/2] Add event type to useBeforeUnload --- 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 be628568357..309006356de 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -1168,7 +1168,7 @@ function isInputElement(object: any): object is HTMLInputElement { * Note: The `callback` argument should be a function created with * `React.useCallback()`. */ -export function useBeforeUnload(callback: () => any): void { +export function useBeforeUnload(callback: (event: BeforeUnloadEvent) => any): void { React.useEffect(() => { window.addEventListener("beforeunload", callback); return () => { From 18548f73adbd49cbec86425f06e11ba442ab4808 Mon Sep 17 00:00:00 2001 From: LimeLine <43731728+Runner-dev@users.noreply.github.com> Date: Sat, 29 Jan 2022 22:01:26 -0700 Subject: [PATCH 2/2] Add name to contributors.yml --- contributors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.yml b/contributors.yml index 3d64642aba1..6ef93d68f36 100644 --- a/contributors.yml +++ b/contributors.yml @@ -132,6 +132,7 @@ - RossJHagan - RossMcMillan92 - rphlmr +- Runner-dev - ryanflorence - sean-roberts - sergiodxa