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

Method renderSquare

examples/00 Chessboard/Tutorial App/Board.js:17–28  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

15 };
16
17 renderSquare(i) {
18 const x = i % 8;
19 const y = Math.floor(i / 8);
20
21 return (
22 <div key={i} style={{ width: '12.5%', height: '12.5%' }}>
23 <BoardSquare x={x} y={y}>
24 {this.renderPiece(x, y)}
25 </BoardSquare>
26 </div>
27 );
28 }
29
30 renderPiece(x, y) {
31 const [knightX, knightY] = this.props.knightPosition;

Callers 1

renderMethod · 0.95

Calls 1

renderPieceMethod · 0.95

Tested by

no test coverage detected