mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 04:33:10 +00:00
The board shows the number range 0-8 instaed of 1-9 (#1034)
This commit is contained in:
@@ -404,7 +404,7 @@ The Board's `renderSquare` method currently looks like this:
|
||||
}
|
||||
```
|
||||
|
||||
In the beginning, we [passed the `value` prop down](#passing-data-through-props) from the Board to show numbers from 1 to 9 in every Square. In a different previous step, we replaced the numbers with an "X" mark [determined by Square's own state](#making-an-interactive-component). This is why Square currently ignores the `value` prop passed to it by the Board.
|
||||
In the beginning, we [passed the `value` prop down](#passing-data-through-props) from the Board to show numbers from 0 to 8 in every Square. In a different previous step, we replaced the numbers with an "X" mark [determined by Square's own state](#making-an-interactive-component). This is why Square currently ignores the `value` prop passed to it by the Board.
|
||||
|
||||
We will now use the prop passing mechanism again. We will modify the Board to instruct each individual Square about its current value (`'X'`, `'O'`, or `null`). We have already defined the `squares` array in the Board's constructor, and we will modify the Board's `renderSquare` method to read from it:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user