-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Testing: Update guidance around unique element IDs #72748
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
Conversation
Technically imported through `@wordpress/element`
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 2.37 MB ℹ️ View Unchanged
|
youknowriad
left a comment
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.
WFM
tyxla
left a comment
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.
Thanks @aduth!
What?
Updates lint rules to reflect updated standards around unique IDs.
Why?
withInstanceIdwas originally created to address a need for standardized unique ID creation, but should ideally be phased out:useInstanceId)useIdhook which serves this purposeHow?
withInstanceIdwith ReactuseIdMath.random. While this may have been an issue historically, it creates a lot of false positive, and there should now be general knowledge ofuseIdfor creating unique IDs that (in combination with the syntax linter around string assignment of IDs) most issues should be avoidableTesting Instructions
Lint checks should pass.