-
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
Edit Site: Optimize useSelect calls #35213
Conversation
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.
Good catch for all of this. Maybe we could build a lint rule
Size Change: +1 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
I will try to create similar PRs per package basis to make reviews easier. @youknowriad, what’s the good use case for omitting |
@Mamaduka I guess sometimes running the selector is quicker than memoization maybe but in reality, I don't think there's any. |
Thanks, I want to make sure I don't add dependency array where it was intentionally left out. The lint rule will also help in these cases since one will have to add a comment to disable the warning. |
Description
Adds missing dependency arrays to
useSelect
calls to memorize selector callbacks in the@wordpress/edit-site
package.Similar PR #23255.
How has this been tested?
The site editor works as expected.
Types of changes
Code Quality/Perfromance
Checklist:
*.native.js
files for terms that need renaming or removal).