Skip to content

[Typo]: Incorrect condition in Chains of computations section #8097

@piowin

Description

@piowin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions