From f4d4226f1c0716a3a4741971d356066f4aef8c9c Mon Sep 17 00:00:00 2001 From: PradipKafleDev Date: Mon, 20 Feb 2023 06:51:31 +1100 Subject: [PATCH] Previously the value that was added with guest was 1(guest=guest+1) and it was resulting different output as compare to the one in react beta doc under keeping components pure , changing the guest value to 2 , (guest=guest+2) will return the desired output as shown in react doc beta--> keeping components pure--> side effects--> untended consequences --- beta/src/content/learn/keeping-components-pure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/src/content/learn/keeping-components-pure.md b/beta/src/content/learn/keeping-components-pure.md index 60760edc5c0..6b959979e83 100644 --- a/beta/src/content/learn/keeping-components-pure.md +++ b/beta/src/content/learn/keeping-components-pure.md @@ -98,7 +98,7 @@ let guest = 0; function Cup() { // Bad: changing a preexisting variable! - guest = guest + 1; + guest = guest + 2; return

Tea cup for guest #{guest}

; }