Skip to content

Clarify browser-only rendering guidance - #8612

Merged
aurorascharff merged 11 commits into
reactjs:mainfrom
aurorascharff:codex/browser-doc-cross-links
Aug 19, 2026
Merged

Clarify browser-only rendering guidance#8612
aurorascharff merged 11 commits into
reactjs:mainfrom
aurorascharff:codex/browser-doc-cross-links

Conversation

@aurorascharff

@aurorascharff aurorascharff commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • mention the Canary browser value in the use introduction and Built-in React APIs overview
  • give use(browser()) its own usage group instead of nesting it under Promise usage
  • distinguish browser-only rendering from hydration's two-pass client/server content pattern
  • link the useLayoutEffect server-rendering guidance to the Canary browser-only API

Why

The browser API reference and examples landed in #8582, but nearby documentation still described use as accepting only Promises and context or presented older browser-only workarounds without mentioning the dedicated Canary API. This follow-up connects those existing entry points while preserving the guidance needed by stable React releases.

Validation

  • yarn lint-heading-ids
  • ESLint on all changed Markdown files
  • yarn deadlinks (all 1,900 links valid)
  • yarn build (all 816 static pages and 219 OG images generated)

@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! 🙌

@aurorascharff
aurorascharff marked this pull request as ready for review August 19, 2026 18:29
Comment thread src/content/reference/react-dom/client/hydrateRoot.md Outdated
Comment thread src/content/reference/react/apis.md
Comment thread src/content/reference/react/apis.md Outdated
Comment thread src/content/reference/react/use.md Outdated

Use this approach when you want the client-rendered content to be different from the initial server-rendered HTML.

<Canary>If a component should render only in the browser, call [`use(browser())`](/reference/react/use#use-browser) instead of waiting for an Effect.</Canary>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note we should probably delete this entire subsection once this ships in stable?

Comment thread src/content/reference/react/use.md Outdated
<Intro>

`use` is a React API that lets you read the value of a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or [context](/learn/passing-data-deeply-with-context).
`use` is a React API that lets you read the value of a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or [context](/learn/passing-data-deeply-with-context). You can also call `use` with the opaque value returned by [`browser`](/reference/react-dom/browser) to mark a component as browser-only during server rendering.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit disproportionate:

Image

Any ideas for how to compress it so that it doesn't take 80% of the explanation for a rare case?

@aurorascharff
aurorascharff merged commit 5b3692a into reactjs:main Aug 19, 2026
5 checks passed
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.

2 participants