Skip to content

Commit

Permalink
fix(remix-react): add event type to useBeforeUnload (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-goncalves authored Oct 28, 2022
1 parent 43eb3d8 commit 5020fa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 5020fa4

Please sign in to comment.