fix: SSR hydration mismatch from Date.now private prop keys#9787
Merged
reidbarber merged 1 commit intomainfrom Mar 12, 2026
Merged
fix: SSR hydration mismatch from Date.now private prop keys#9787reidbarber merged 1 commit intomainfrom
reidbarber merged 1 commit intomainfrom
Conversation
devongovett
approved these changes
Mar 12, 2026
yihuiliao
approved these changes
Mar 12, 2026
| // Ideally we'd use a Symbol for this, but React doesn't support them: https://github.com/facebook/react/issues/7552 | ||
| export const roleSymbol: string = '__role_' + Date.now(); | ||
| export const focusManagerSymbol: string = '__focusManager_' + Date.now(); | ||
| // These need to be stable across server and client module evaluation for SSR hydration. |
Member
There was a problem hiding this comment.
looks like that github issue is closed, can we use a symbol if the React version is 18+? would that be stable across the two environments?
Member
Author
There was a problem hiding this comment.
Looks like it was never added: facebook/react#7552 (comment)
Member
There was a problem hiding this comment.
doh, i should read more. I wish github would mark it a different color, i just saw merged prs and assumed
Member
Author
There was a problem hiding this comment.
Yep haha, I thought the same thing at first glance
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.
Closes #9786
Removes Date.now from private prop keys to avoid SSR hydration mismatch issues. Not really sure of a better solution than just using a static string.
✅ Pull Request Checklist:
📝 Test Instructions:
Smoke test date picker and form validation.
🧢 Your Project: