Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: useBeforeUnload TypeScript issue #1719

Closed
alexluong opened this issue Jan 29, 2022 · 3 comments · Fixed by #1723
Closed

[Bug]: useBeforeUnload TypeScript issue #1719

alexluong opened this issue Jan 29, 2022 · 3 comments · Fixed by #1723
Labels

Comments

@alexluong
Copy link

alexluong commented Jan 29, 2022

Which Remix packages are impacted?

  • @remix-run/react

What version of Remix are you using?

1.1.1

What version of Node are you using? Minimum supported version is 14.

16.13.1

Steps to Reproduce

Use useBeforeUnload like so:

useBeforeUnload(
    useCallback((e) => {
      e.preventDefault();
      e.returnValue = "";
    }, [])
  );

Expected Behavior

There is no type error

Actual Behavior

Error: Argument of type '(e: any) => void' is not assignable to parameter of type '() => any'.ts(2345)

CleanShot 2022-01-29 at 14 37 51@2x

@alexluong alexluong added the bug Something isn't working label Jan 29, 2022
@alexluong
Copy link
Author

I'd love to open a PR and fix if yall are open to contribution here

@chaance
Copy link
Collaborator

chaance commented Oct 28, 2022

Merged 🥳 #1723

@chaance chaance closed this as completed Oct 28, 2022
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-5020fa4-20221029 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants