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

Method render

examples/00 Chessboard/Tutorial App/BoardSquare.js:54–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 }
53
54 render() {
55 const { x, y, connectDropTarget, isOver, canDrop, children } = this.props;
56 const black = (x + y) % 2 === 1;
57
58 return connectDropTarget(
59 <div
60 style={{
61 position: 'relative',
62 width: '100%',
63 height: '100%',
64 }}
65 >
66 <Square black={black}>
67 {children}
68 </Square>
69 {isOver && !canDrop && this.renderOverlay('red')}
70 {!isOver && canDrop && this.renderOverlay('yellow')}
71 {isOver && canDrop && this.renderOverlay('green')}
72 </div>,
73 );
74 }
75}

Callers

nothing calls this directly

Calls 1

renderOverlayMethod · 0.95

Tested by

no test coverage detected