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

UseInteractionsReturn is missing #2873

Closed
rrojas-prmnt opened this issue Apr 22, 2024 · 1 comment · Fixed by #2879
Closed

UseInteractionsReturn is missing #2873

rrojas-prmnt opened this issue Apr 22, 2024 · 1 comment · Fixed by #2879

Comments

@rrojas-prmnt
Copy link

Hello!

I was using the useInteractions hook and needed to export the return type. However, I've discovered that this interface does not exist in @floating-ui/react. The only workaround is to recreate it myself. After considering this and comparing it to other hooks that already have the return type implemented, I'm wondering whether this interface should be created in the library or if I should implement it myself.

For more details, you can refer to the documentation on the return value of the useInteractions hook: https://floating-ui.com/docs/useInteractions#return-value. Is this a missing type in the library?

You can also compare it with the useFloating hook: https://floating-ui.com/docs/useFloating#return-value. In this case, the return type (UseFloatingReturn) already exists in the library.

image

Originally posted by @rrojas-prmnt in #2838

@atomiks
Copy link
Collaborator

atomiks commented Apr 28, 2024

That type was for demonstration as it actually just uses the inferred return value. I've created it and exported here: #2879

Also, you can always use type UseInteractionsReturn = ReturnValue<typeof useInteractions> to extract the value yourself.

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

Successfully merging a pull request may close this issue.

2 participants