react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Bug: Function return different output as compared to the output that is shown in React Docs Beta

Open PradipKafleDev opened this issue 2 years ago • 4 comments
trafficstars

React doc beta--> keeping components pure--> side effects:(un)intended consequences : Previously the value that was added with guest was 1(guest=guest+1) and which results different output as compare to the output image thats shows in react beta doc , changing the guest value to 2 , (guest=guest+2) will return the desired output as shown in the output image in react beta doc

#5606

PradipKafleDev avatar Feb 19 '23 19:02 PradipKafleDev

Hi @PradipKafleDev!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Feb 19 '23 19:02 facebook-github-bot

Size Changes

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

This PR introduced no changes to the javascript bundle 🙌

github-actions[bot] avatar Feb 19 '23 19:02 github-actions[bot]

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

facebook-github-bot avatar Feb 19 '23 21:02 facebook-github-bot

The output produce by the TeaSet() shows in react beta doc==>keeping components pure==>Side Effects: (un)intended consequences is : Tea cup for guest #2 Tea cup for guest #4 Tea cup for guest #6 , But which is not correct because the guest variable is incremented buy +1 so in order to to get 2,4,6 we should add +2 with guest variable. @gaearon

PradipKafleDev avatar Feb 20 '23 04:02 PradipKafleDev