-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Rating] Use Rating name
as prefix of input element ids
#43829
[material-ui][Rating] Use Rating name
as prefix of input element ids
#43829
Conversation
Netlify deploy previewhttps://deploy-preview-43829--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
name
as prefix of generated id-sname
as prefix of input element ids
name
as prefix of input element idsname
as prefix of input element ids
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 good. We also need to add unit test for it.
Sure, will add one & update the PR |
Co-authored-by: Zeeshan Tamboli <[email protected]> Signed-off-by: Yash Shah <[email protected]>
@ZeeshanTamboli I've added the unit test. Let me know if anything needs an update. |
// preventing one component from affecting another. React 18's useId already handles this. | ||
// Update to const id = useId(); when React 17 support is dropped. | ||
// More details: https://github.com/mui/material-ui/issues/40997 | ||
const id = `${name}-${useId()}`; |
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.
I changed it to this since name
will always be available either through provided prop or generated through useId
below.
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 good! Thanks @yash49. I also fixed a typo in the API description.
Thanks @ZeeshanTamboli 🙌 |
fixes #40997