Repository navigation
[lts-active] docs: lead with use(browser()) for browser-only rendering - #102461
Merged
icyJoseph merged 1 commit intoNov 26, 2026
Merged
Conversation
## What Updates "Rendering components only in the browser" in the Single-Page Applications guide, plus a pointer from the Lazy Loading guide. - Leads with `use(browser())` inside a Suspense boundary as the way to render a component only in the browser. - Keeps `next/dynamic` with `ssr: false` for large components that are not needed when the page loads, where the code splitting is the point. - Adds guidance on Largest Contentful Paint and on sizing the fallback. - Links the React Suspense caveats for the reveal timing. - Drops the `useEffect` suggestion. ## Why The section presented `next/dynamic` with `ssr: false` as the default. That option also code splits, so the component's bundle is requested after hydration, and `React.lazy` suspends on its first client render. The content then arrives as a retried Suspense boundary, which React reveals [at most once every 300ms](https://react.dev/reference/react/Suspense#caveats). With `use(browser())` and a static import nothing suspends in the browser, so the component renders in the same pass that hydrates the page. Measured on a production build of a small repro (Next.js 16.4.6, React 19.3.0, headless Chrome, medians): | | content committed | LCP | |---|---|---| | `next/dynamic` with `ssr: false` | 303ms | 324ms | | `use(browser())` in `<Suspense>` | 33ms | 44ms | On a soft navigation, the `next/dynamic` version showed its fallback for about 300ms with the chunk already cached. The `use(browser())` version rendered the content directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) (cherry picked from commit 29c0ed0)
Contributor
Tests PassedCommit: b43f3e7 |
icyJoseph
marked this pull request as ready for review
November 26, 2026 16:06
Contributor
Code review ?
Summary
Docs-only backport to the LTS branch. It rewrites the 'Rendering components only in the browser' guide to lead with use(browser()) inside a Suspense boundary, moves next/dynamic with ssr:false into a follow-up section on module-level browser code and lazy loading, and adds a cross-link from the lazy-loading guide. I checked the technical claims against the head's source. No code changed and there were no tests to run. Checked (3)
|
aurorascharff
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports docs: lead with use(browser()) for browser-only rendering (#102401) to
releases/lts/active.Cherry-picked from 29c0ed0 with
git cherry-pick -x; it applied cleanly with no conflicts.