diff --git a/docs/next/intro-react.html b/docs/next/intro-react.html index 5afd1b86bc9..d4ed07ae85f 100644 --- a/docs/next/intro-react.html +++ b/docs/next/intro-react.html @@ -502,7 +502,7 @@ export default function Cafe() { />
-You might’ve noticed that although
+isHungryis a const, it is seemingly reassignable! What is happening is when a state-setting function likesetIsHungryis called, its component will re-render. In this caseCatwill re-render its<Cat>—discarding the oldisHungryand runningsetStateagain with the new value in the process!You might’ve noticed that although
isHungryis a const, it is seemingly reassignable! What is happening is when a state-setting function likesetIsHungryis called, its component will re-render. In this case theCatfunction will run again—and this time,useStatewill give us the next value ofisHungry.
Finally, put your cats inside a Cafe component:
export default function Cafe() {
diff --git a/docs/next/intro-react/index.html b/docs/next/intro-react/index.html
index 5afd1b86bc9..d4ed07ae85f 100644
--- a/docs/next/intro-react/index.html
+++ b/docs/next/intro-react/index.html
@@ -502,7 +502,7 @@ export default function Cafe() {
/>
-You might’ve noticed that although
+isHungryis a const, it is seemingly reassignable! What is happening is when a state-setting function likesetIsHungryis called, its component will re-render. In this caseCatwill re-render its<Cat>—discarding the oldisHungryand runningsetStateagain with the new value in the process!You might’ve noticed that although
isHungryis a const, it is seemingly reassignable! What is happening is when a state-setting function likesetIsHungryis called, its component will re-render. In this case theCatfunction will run again—and this time,useStatewill give us the next value ofisHungry.
Finally, put your cats inside a Cafe component:
export default function Cafe() {