mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-26 18:58:17 +00:00
Minor edit
This commit is contained in:
@@ -830,7 +830,7 @@ class Game extends React.Component {
|
||||
}
|
||||
```
|
||||
|
||||
Next, we'll have the Board component receive `squares` and `onClick` props from the Game component by props. Since we now have a single click handler in Board for many Squares, we'll need to pass the location of each Square into the `onClick` handler to indicate which Square was clicked. Here are the required steps to transform the Board component:
|
||||
Next, we'll have the Board component receive `squares` and `onClick` props from the Game component. Since we now have a single click handler in Board for many Squares, we'll need to pass the location of each Square into the `onClick` handler to indicate which Square was clicked. Here are the required steps to transform the Board component:
|
||||
|
||||
* Delete the `constructor` in Board.
|
||||
* Replace `this.state.squares[i]` with `this.props.squares[i]` in Board's `renderSquare`.
|
||||
|
||||
Reference in New Issue
Block a user