mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Clarity on constructor of Board object for tutorial.md (#8224)
* Update tutorial.md Is it possible to be more clear here? This implies that we are removing the constructor from GAME, and not board (which is what I believe the author is trying to say). It took me several reads to understand. With this edit, it is now clear that the adjustment is being made to -Board- and not to -Game- * also remove "for Board earlier"
This commit is contained in:
@@ -353,7 +353,7 @@ class Game extends React.Component {
|
||||
}
|
||||
```
|
||||
|
||||
Then remove the constructor and change `Board` so that it takes `squares` via props and has its own `onClick` prop specified by `Game`, like the transformation we made for `Square` and `Board` earlier. You can pass the location of each square into the click handler so that we still know which square was clicked:
|
||||
Then remove the constructor from `Board` and change `Board` so that it takes `squares` via props and has its own `onClick` prop specified by `Game`, like the transformation we made for `Square` earlier. You can pass the location of each square into the click handler so that we still know which square was clicked:
|
||||
|
||||
```javascript
|
||||
return <Square value={this.props.squares[i]} onClick={() => this.props.onClick(i)} />;
|
||||
|
||||
Reference in New Issue
Block a user