Feature/432 wildcard drop target#440
Conversation
|
I'm going to close this out for now, it may make sense to have a predicate function here at some point, but I think using rest/spread to splat an array out would suffice. |
|
is this going to be merged? id very much like to use this. have a dnd component that can be used in many contexts and shouldn't have to know exactly which types it can accept |
|
Probably not as-is. The original PR that @froatsnook submitted was two separate PRs across projects. Since we've restructured to a monorepo the PR would need to be resubmitted. I'd like to think through this feature request a bit more. I'm not sure a wildcard is the most friendly way to approach this. A predicate function may make sense e.g. |
|
okay cool, thank you. i agree w/ the predicate function, but there should definitely be some solution to this problem so that dTargets don't have to know every single type dSource they need to respond to in advance.. it really makes it harder to build reusable dnd components, and i see no advantage since you can simply check the dragged item type in the hover/drop methods before doing anything. will keep an eye out for it, thanks for the work you've done on this library 😄 |
|
@froatsnook this is an old PR. We have canDrop() which can be used for similar purpose. Can you close this PR? |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
New feature for #432
There's a hard dependency on react-dnd/dnd-core#31 since I'm using the new
isValidSourceTypeandisValidTargetType