MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / drop

Function drop

examples/03 Nesting/Drop Targets/Dustbin.js:23–33  ·  view source on GitHub ↗
(props, monitor, component)

Source from the content-addressed store, hash-verified

21
22const boxTarget = {
23 drop(props, monitor, component) {
24 const hasDroppedOnChild = monitor.didDrop();
25 if (hasDroppedOnChild && !props.greedy) {
26 return;
27 }
28
29 component.setState({
30 hasDropped: true,
31 hasDroppedOnChild,
32 });
33 },
34};
35
36@DropTarget(ItemTypes.BOX, boxTarget, (connect, monitor) => ({

Callers

nothing calls this directly

Calls 1

didDropMethod · 0.45

Tested by

no test coverage detected