Skip to content

Commit 2c601f3

Browse files
committed
fixing bug
1 parent 650cc97 commit 2c601f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

reactjsfoundations.com/src/chapter04/ClassComponentState.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ClassComponentState extends Component {
1717
<p>The current count is: {this.state.count}.</p>
1818
<button
1919
onClick={() => {
20-
this.incrementCount(this.state.count + 1);
20+
this.incrementCount();
2121
}}
2222
>
2323
Add 1
@@ -39,7 +39,7 @@ class ClassComponentState extends Component {
3939
return (
4040
<div>
4141
<p>The current count is: {this.state.count}.</p>
42-
<button onClick = {()=>{this.incrementCount(this.state.count+1)}}>
42+
<button onClick = {()=>{this.incrementCount()}}>
4343
Add 1
4444
</button>
4545
</div>

reactjsfoundations.com/src/chapter04/SetStateAsync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SetStateAsync extends Component {
1818
<p>The current count is: {this.state.count}.</p>
1919
<button
2020
onClick={() => {
21-
this.incrementCount(this.state.count + 1);
21+
this.incrementCount();
2222
}}
2323
>
2424
Add 1
@@ -41,7 +41,7 @@ class SetStateAsync extends Component {
4141
return (
4242
<div>
4343
<p>The current count is: {this.state.count}.</p>
44-
<button onClick = {()=>{this.incrementCount(this.state.count+1)}}>
44+
<button onClick = {()=>{this.incrementCount()}}>
4545
Add 1
4646
</button>
4747
</div>

0 commit comments

Comments
 (0)