Skip to content

Fix hydration mismatch in SSR client components#8

Merged
demattosanthony merged 1 commit into
mainfrom
claude/fix-ssr-hydration-mismatch-ppLUY
Dec 18, 2025
Merged

Fix hydration mismatch in SSR client components#8
demattosanthony merged 1 commit into
mainfrom
claude/fix-ssr-hydration-mismatch-ppLUY

Conversation

@demattosanthony
Copy link
Copy Markdown
Owner

Resolves hydration errors where aria-controls IDs differ between server and client rendering.

The issue occurred because renderToReadableStream() was called without the identifierPrefix option, causing React's internal ID counters to generate different IDs on server vs client. This particularly affected Radix UI components (Dialog, Popover, etc.) that rely on React's useId() hook.

The fix adds identifierPrefix: '' to renderToReadableStream options, ensuring consistent ID generation across server rendering and client hydration.

Affected file: packages/bunbox/src/core/ssr.tsx:469

Resolves hydration errors where aria-controls IDs differ between server and client rendering.

The issue occurred because renderToReadableStream() was called without the identifierPrefix option, causing React's internal ID counters to generate different IDs on server vs client. This particularly affected Radix UI components (Dialog, Popover, etc.) that rely on React's useId() hook.

The fix adds identifierPrefix: '' to renderToReadableStream options, ensuring consistent ID generation across server rendering and client hydration.

Affected file: packages/bunbox/src/core/ssr.tsx:469
@demattosanthony demattosanthony merged commit f1724f9 into main Dec 18, 2025
1 check passed
@demattosanthony demattosanthony deleted the claude/fix-ssr-hydration-mismatch-ppLUY branch December 18, 2025 22:29
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