-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Remove unused useLatestRef()
hook
#59471
Conversation
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: 1.71 MB ℹ️ View Unchanged
|
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.
The pattern is used ad hoc in various places in the components package so an alternative would be to replace such instances with the hook yet I don't feel there’s a clear advantage to that. LGTM.
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 had a quick search in WPDirectory, and although there are a few references to useLatestRef
, none of them seem like they'll cause an issue. Either it's being defined independently within other projects, or being bundled but not used.
So I think we should be good to go 🚀
What?
This PR removes the
useLatestRef()
hook from the components package.Why?
It was never used since its creation almost 3 years ago in #33137.
How?
Just removing the unused code.
Testing Instructions
All should be green.
Testing Instructions for Keyboard
None
Screenshots or screencast
None