Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

PradipKafleDev
Copy link

@PradipKafleDev PradipKafleDev commented Feb 19, 2023

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

…nd 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
@facebook-github-bot
Copy link
Collaborator

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!

@github-actions
Copy link

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 🙌

@facebook-github-bot
Copy link
Collaborator

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

@PradipKafleDev PradipKafleDev changed the title Previously the value that was added with guest was 1(guest=guest+1) … Function returns different output as compared to the output that is shown Feb 20, 2023
@PradipKafleDev PradipKafleDev changed the title Function returns different output as compared to the output that is shown Bug: Function return different output as compared to the output that is shown in React Docs Beta Feb 20, 2023
@PradipKafleDev
Copy link
Author

PradipKafleDev commented Feb 20, 2023

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 PradipKafleDev deleted the Change-the-value-that-return-incorrect-output branch November 22, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants