-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use @react-aria/ssr for isomorphic ID generation. #1409
Conversation
🦋 Changeset detectedLatest commit: 841ad7f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
per adobe/react-spectrum#2278 (comment), we might get a release early next week. |
9ab697b
to
364806c
Compare
e31b323
to
838b035
Compare
@@ -0,0 +1,37 @@ | |||
--- | |||
title: Server-side rendering with Primer React |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for writing docs! 💖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this doc to the side nav? https://github.com/primer/react/blob/main/docs/src/%40primer/gatsby-theme-doctocat/nav.yml
@@ -1,3 +1,5 @@ | |||
// Note: uniqueId may be unsafe in SSR contexts if it is used create DOM IDs or otherwise cause a hydration warning. Use useSSRSafeId instead. | |||
|
|||
let idSeed = 10000 | |||
export function uniqueId(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is uniqueId
still useful if we have useSSRSafeId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one place where it's still used — the useFocusZone
behavior. I believe it's safe because it's only called downstream of a user interaction. As far as I can tell, we'd need to do a decent refactoring or just require that IDs are already in place to get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just left a few minor comments.
Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
Closes #1392
Screenshots
Please provide before/after screenshots for any visual changes
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.