Skip to content

Commit e39e14d

Browse files
authored
Update intro-react.md
1 parent 53cad51 commit e39e14d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎docs/intro-react.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ Now, when someone presses the button, `onPress` will fire, calling the `setIsHun
394394
/>
395395
```
396396

397-
> You might’ve noticed that although `isHungry` is a [const](https://developer.mozilla.org/Web/JavaScript/Reference/Statements/const), it is seemingly reassignable! What is happening is when a state-setting function like `setIsHungry` is called, its component will re-render. In this case the `Cat` function will run again with the new value of `isHungry`, and return a `<Button>` with the new `title`!
397+
> You might’ve noticed that although `isHungry` is a [const](https://developer.mozilla.org/Web/JavaScript/Reference/Statements/const), it is seemingly reassignable! What is happening is when a state-setting function like `setIsHungry` is called, its component will re-render. In this case the `Cat` function will run again, and this time, `useState` will give us the next value of `isHungry`, which we use to render the `<Button>`. The old value is discarded when we set the state!
398398
399399
Finally, put your cats inside a `Cafe` component:
400400

0 commit comments

Comments
 (0)