Skip to content

Commit 883206b

Browse files
committed
1st step: Add interactive behaviour to Square Component.
1 parent 029b67d commit 883206b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class Board extends React.Component {
5252
class Square extends React.Component {
5353
render() {
5454
return (
55-
<button className="square">
55+
<button className="square" onClick={() => alert('click')}> {/* Same as: onClick={function() { alert('click'); }}
56+
* + Avoid confusing behavior
57+
* + Save typing
58+
* */}
5659
{this.props.value}
5760
</button>
5861
);

0 commit comments

Comments
 (0)