-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Hook functions require a void return type #695
Comments
If we change the return type to |
This is what the flow docs recommend for cases like this. I think people familiar with flow will understand that the return value may not actually be used. If you're still concerned, you could explain why the return type is mixed by the type definition. |
Fair enough! Happy to update the types. I think it would be also worth calling out in the docs that we do not use the return type |
I think this would be a good candidate for a first contribution 😊 |
This will ship in our next release! Thanks @kylehalleman!! |
I'm not sure if this should be filed under bug or feature request.
Basically the hooks have a void return type, which means that you can't return any value, whether the return value is used or not.
This means that we can't do:
Instead, we have to proxy the function like this:
Since the return isn't used anyway, is there a reason why these aren't typed with a
mixed
return type? This is how I typically type event handlers in order to give more freedom.The text was updated successfully, but these errors were encountered: