Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
@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.

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

        AltStyle によって変換されたページ (->オリジナル) /