Skip to content

Commit 29cb77f

Browse files
committed
3rd step: Link Board Component with the Game Component.
1 parent 75c1b5c commit 29cb77f

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/index.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Game extends React.Component {
77
return (
88
<div className="game"> {/* React comment example */}
99
<div className="game-board"> {/* Space destined to host an specific component */}
10-
Game Board
10+
<Board /> {/* (3rd step) Link Board component with Game component */}
1111
</div>
1212
<div className="game-info"> {/* Space destined to log Game actions */}
1313
</div>
@@ -16,6 +16,29 @@ class Game extends React.Component {
1616
}
1717
}
1818

19+
20+
class Board extends React.Component {
21+
render() {
22+
const status = 'Next Player X'; // Board need to know who is playing, set initial Board state to player 'X' or 'O'.
23+
24+
return ( // We want a [3row x 3col] tic-tac-toe
25+
<div>
26+
<div className="status">{status}</div>
27+
<div className="board-row">Row
28+
{/* Insert row-Squares-amount here (4th step) */}
29+
</div>
30+
<div className="board-row">Row
31+
{/* Insert row-Squares-amount here (4th step) */}
32+
</div>
33+
<div className="board-row">Row
34+
{/* Insert row-Squares-amount here (4th step) */}
35+
</div>
36+
</div>
37+
);
38+
}
39+
}
40+
41+
1942
// ==================================
2043

2144
ReactDOM.render(

0 commit comments

Comments
 (0)