Replies: 2 comments
-
The |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks! That makes sense. I was thinking that maybe there was a way of doing it internally and then exposing the already 'guarded' versions of
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using
onDrop
with the newuseDrop
hook, doesn't infer correctly theDropItem
type when using typescript.Here is a codesandbox that demonstrates the issue. It's using the same code as the example from the official docs.
I've fixed it using a type guard, here is the working codesandbox, but basically:
And then filtering out the files like so:
Is there a reason
useDrop
can't infer theDropItem
type correctly without having to write a guard manually?Or am I missing something?
Loving the new hook! Great work! 🙌
Beta Was this translation helpful? Give feedback.
All reactions