Skip to content

docs: explain nextId mutation in array challenge - #8746

Open
rickvian wants to merge 1 commit into
reactjs:mainfrom
rickvian:docs/explain-nextid-mutation
Open

rickvian wants to merge 1 commit into
reactjs:mainfrom
rickvian:docs/explain-nextid-mutation

Conversation

@rickvian

@rickvian rickvian commented Nov 10, 2026 •

Copy link
Copy Markdown

Explains why incrementing nextId is okay in the “Updating Arrays in State” challenge solution: the counter is mutated in a user event handler, while the todos state is still updated with a new array.

Fixes #5672

Test plan

  • Local render: Started the docs app and confirmed /learn/updating-arrays-in-state#updating-objects-inside-arrays returned HTTP 200 with the note and immutable-state explanation.
  • Regression: The rendered solution still describes using map for edits and filter for deletion.
  • Lint: Node v24.22.2 via NVM, Yarn 1.22.22 via Corepack; yarn lint passed (with existing unrelated <img> warnings).
  • No automated tests were run; this is a documentation-only change.

@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

This branch was successfully deployed

1 active deployment
Preview — 0d15c0f1 Deployed Nov 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Challenge Solution in "Updating Arrays in State" Page Uses Mutation

1 participant