-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Open
Labels
@piowin
Description
Summary
The logic in the "fixed" example from the "Chains of computations" section of the You Might Not Need an Effect page (the one replacing the chain of effects) seems to be incorrect — the condition should use goldCardCount < 3 instead of goldCardCount <= 3.
Page
https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations
Details
In the "Chains of computations" section of the You Might Not Need an Effect page, the "fixed" example uses the condition goldCardCount <= 3.
This causes the player to pick a gold card five times instead of four (as in the original example) to advance to the next round, effectively changing the game logic.
Replacing the condition with goldCardCount < 3 should fix the issue.