Lifting State Up more legible (#8691)
John Longanecker committed
Feb 1, 2017 at 20:31 UTC
b8f0522cc6cb77d192f9adc42438886b6ebc5e7b
1 file changed
+2
docs/tutorial/tutorial.md
+2
@@ -187,6 +187,8 @@ Now we're passing down two props from Board to Square: `value` and `onClick`. Th
187
188
```javascript
189
<button className="square" onClick={() => this.props.onClick()}>
190
+ {this.props.value}
191
+</button>
192
```
193
194
This means that when the square is clicked, it calls the onClick function that was passed by the parent. The `onClick` doesn't have any special meaning here, but it's popular to name handler props starting with `on` and their implementations with `handle`. Try clicking a square – you should get an error because we haven't defined `handleClick` yet. Add it to the Board class: