-
Notifications
You must be signed in to change notification settings - Fork 465
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
Inline auto curried async functions produce invalid javascript #6007
Milestone
Comments
This seems to have to do with type callback<'input, 'output> = 'input => 'output
@module("react")
external useCallback: (@uncurry ('input => 'output)) => callback<'input, 'output> = "useCallback"
let onSubmit = () =>
useCallback(async (_a, b) => {
await b
}) |
cristianoc
added a commit
that referenced
this issue
Feb 19, 2023
cristianoc
added a commit
that referenced
this issue
Feb 19, 2023
Thanks @cristianoc 🙌 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for filing! Check list:
see: rescript-lang/rescript-react#89
I noticed that when passing this async function:
it results in the following JS code which does not compile as the function is not async:
the issue can be avoided by assigning the callback to a variable:
compiles to:
The text was updated successfully, but these errors were encountered: