feat(core): support React 19 browser() in BrowserOnly - #12443
Closed
sanjaiyan-dev wants to merge 2 commits into
Closed
sanjaiyan-dev wants to merge 2 commits into
sanjaiyan-dev wants to merge 2 commits into
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
SapanMozammel
left a comment
There was a problem hiding this comment.
Great integration with React 19.3+ browser() API and Suspense bailout handling! Clean fallback for legacy React versions as well.
2 of 3 tasks
Collaborator
|
Closing in favor of #12496 |
slorber
added a commit
that referenced
this pull request
Sep 25, 2026
…assisted) Use `use(browser())` inside a `<Suspense>` boundary instead of the `useIsBrowser()` context: React now skips the children during SSR and renders them on the client after hydration. The `<BrowserOnly>` fallback is now also displayed while children suspend, instead of propagating to the parent Suspense boundary. Supersedes #12443 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slorber
added a commit
that referenced
this pull request
Sep 25, 2026
…assisted) Use `use(browser())` inside a `<Suspense>` boundary instead of the `useIsBrowser()` context: React now skips the children during SSR and renders them on the client after hydration. The `<BrowserOnly>` fallback is now also displayed while children suspend, instead of propagating to the parent Suspense boundary. Supersedes #12443 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slorber
added a commit
that referenced
this pull request
Sep 25, 2026
…assisted) Use `use(browser())` inside a `<Suspense>` boundary instead of the `useIsBrowser()` context: React now skips the children during SSR and renders them on the client after hydration. The `<BrowserOnly>` fallback is now also displayed while children suspend, instead of propagating to the parent Suspense boundary. Supersedes #12443 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Pre-flight checklist
Motivation
This PR updates
BrowserOnlyto support React 19's newuse(browser())API while keeping full backward compatibility with React 18.Why this is needed:
useEffectimplementation always forces a double-render cycle on the client after initial mount.browser()gracefully bails out during SSR to a native<Suspense>fallback, eliminating visual flicker and layout shifts during hydration.BrowserOnlyProps) remains exactly the same.useEffectbehavior.Extremely sorry if I made any mistakes