File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
reactjsfoundations.com/src/chapter04 Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class ClassComponentState extends Component {
17
17
< p > The current count is: { this . state . count } .</ p >
18
18
< button
19
19
onClick = { ( ) => {
20
- this . incrementCount ( this . state . count + 1 ) ;
20
+ this . incrementCount ( ) ;
21
21
} }
22
22
>
23
23
Add 1
@@ -39,7 +39,7 @@ class ClassComponentState extends Component {
39
39
return (
40
40
<div>
41
41
<p>The current count is: {this.state.count}.</p>
42
- <button onClick = {()=>{this.incrementCount(this.state.count+1 )}}>
42
+ <button onClick = {()=>{this.incrementCount()}}>
43
43
Add 1
44
44
</button>
45
45
</div>
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class SetStateAsync extends Component {
18
18
< p > The current count is: { this . state . count } .</ p >
19
19
< button
20
20
onClick = { ( ) => {
21
- this . incrementCount ( this . state . count + 1 ) ;
21
+ this . incrementCount ( ) ;
22
22
} }
23
23
>
24
24
Add 1
@@ -41,7 +41,7 @@ class SetStateAsync extends Component {
41
41
return (
42
42
<div>
43
43
<p>The current count is: {this.state.count}.</p>
44
- <button onClick = {()=>{this.incrementCount(this.state.count+1 )}}>
44
+ <button onClick = {()=>{this.incrementCount()}}>
45
45
Add 1
46
46
</button>
47
47
</div>
You can’t perform that action at this time.
0 commit comments