Constructor
new Board(props)
Board constructor.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | component input.
Properties
|
Extends
- React.Component
Methods
render() → {HTMLDivElement}
Renders the 9 squares of the board.
- Source:
Returns:
a <div> tag with a 3 × 3 grid layout, with 3
buttons per row, each of which with value 'X', 'O' or null.
- Type
- HTMLDivElement
renderSquare(i) → {Square}
We’ll pass down a prop, from the Board to the Square,
with a value and function, and we’ll have Square call
that function when a square is clicked.
Parameters:
Name | Type | Description |
---|---|---|
i |
Number | square index ∈ [0..8]. |
- Source:
Returns:
the i-th square with its value and click callback.
- Type
- Square