You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use it to specify whether the drop target is able to accept the item. If you want to always allow it, just omit this method. Specifying it is handy if you'd like to disable dropping based on some predicate over propsor monitor.getItem(). Note: You may not call monitor.canDrop()inside this method.
One workaround is to determine if a drop is allowed in retrospective, in onDragStop so that you undo a drop which should not be allowed. This is far from optimal, hence I'd love to hear more ideas.
EDIT even taking suggestions from #382 into account I wasn't to programatically update the layout. Hence I resorted to extreme measures, more precisely, I reinstantiated the component to force it to render with the updated layout (the kind of thing which happens to you if you accidentally pass an inline function as the component prop of a Route from react-router-dom).
Use it to specify whether the drop target is able to accept the item. If you want to always allow it, just omit this method. Specifying it is handy if you'd like to disable dropping based on some predicate over propsor monitor.getItem(). Note: You may not call monitor.canDrop()inside this method.
Source react-dnd
The text was updated successfully, but these errors were encountered: