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

[Suggestion]: Tic-tac-toe tutorial should explicitly explain that mutation causes unreliable re-rendering #8086

Open
@sam77777777777

Description

Summary

The tutorial's Why immutability is important section doesn't clearly state that mutating state causes unreliable re-rendering behavior.

Page

https://react.dev/learn/tutorial-tic-tac-toe#why-immutability-is-important

Details

While following the tic-tac-toe tutorial, I was confused about why .slice() is necessary. The "Why immutability is important" section talks about time travel features and performance optimizations, but it never explains that mutating the array directly will cause React to not reliably detect the change, meaning the component may not re-render.

It seems as though that is the primary reason the tutorial uses .slice(), but it's not mentioned. I only found this explanation later in the "Updating Objects in State" article. It would be helpful to include this explanation in the tutorial where beginners first encounter the pattern.

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 によって変換されたページ (->オリジナル) /