Skip to content

Commit 2627e5a

Browse files
Clarify useState update explanation
1 parent 046f17d commit 2627e5a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/content/learn/index.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ function MyButton() {
334334
</button>
335335
);
336336
}
337-
```
338337

339-
React will call your component function again. This time, `count` will be `1`. Then it will be `2`. And so on.
338+
339+
Calling `setCount` tells React to re-render your component. This time, `count` will be `1`. Then it will be `2`. And so on.
340+
340341

341342
If you render the same component multiple times, each will get its own state. Click each button separately:
342343

0 commit comments

Comments
 (0)