Skip to content

Fix premature pending visual state in useTransition docs - #8767

Open
vanibhardwaj05 wants to merge 1 commit into
reactjs:mainfrom
vanibhardwaj05:fix/use-transition-docs-pending-state
Open

vanibhardwaj05 wants to merge 1 commit into
reactjs:mainfrom
vanibhardwaj05:fix/use-transition-docs-pending-state

Conversation

@vanibhardwaj05

@vanibhardwaj05 vanibhardwaj05 commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Fixes #8710

Problem Description

In src/content/reference/react/useTransition.md, under the Exposing action prop from components section:

  • The introductory static code snippet defines TabButton by wrapping the action prop in startTransition, without any if (isPending) check.
  • However, the interactive Sandpack demo underneath prematurely bundled:
    if (isPending) {
      return <b className="pending">{children}</b>;
    }
    along with .pending { color: #777; } in its CSS stylesheet.

This created a confusing pedagogical contradiction with the immediately following section (Displaying a pending visual state), which is meant to introduce and explain isPending visual feedback for the first time. Readers observed the pending state in the first demo, rendering the second demonstration redundant.

Solution

  • Removed the premature if (isPending) condition from src/TabButton.js in the Section 1 Sandpack demo.
  • Removed the unused .pending { color: #777; } rule from the Section 1 stylesheet.
  • Maintained the Section 2 demo as the dedicated milestone where pending visual state is introduced.

Verification

  • Confirmed that the Section 1 Sandpack code now matches its explanatory code block line-for-line.
  • Verified that Section 2 now clearly demonstrates the UI feedback improvement over Section 1.
  • All Sandpack markdown delimiters and structure remain syntactically valid.

@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 — 857f91c7 Deployed Nov 20, 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.

[Typo]: confusing mistake in useTransition docs

1 participant