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

Method render

examples/01 Dustbin/Copy or Move/Dustbin.js:41–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 };
40
41 render() {
42 const { canDrop, isOver, allowedDropEffect, connectDropTarget } = this.props;
43 const isActive = canDrop && isOver;
44
45 let backgroundColor = '#222';
46 if (isActive) {
47 backgroundColor = 'darkgreen';
48 } else if (canDrop) {
49 backgroundColor = 'darkkhaki';
50 }
51
52 return connectDropTarget(
53 <div style={{ ...style, backgroundColor }}>
54 { `Works with ${allowedDropEffect} drop effect` }<br /><br />
55 {isActive ?
56 'Release to drop' :
57 'Drag a box here'
58 }
59 </div>,
60 );
61 }
62}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected