-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Refactor latest content selectors in 'CopyContentMenuItem' components #53676
Conversation
Size Change: -4 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Hey, @jorgefilipecosta, do you mind double checking this refactoring? Thanks 🙏 |
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've tested and the “Copy all blocks” menu item works as expected in both the Post and Site editors and avoids the console warning. 🚢
This served as a good reminder for me of the succinct form of useSelect
. Wish I’d seen this earlier and I would have avoided some effort in #53833 😅.
What?
Discovered while working on #53666.
This is similar to #53672.
PR refactors the latest content selectors in the 'CopyContentMenuItem' components to avoid returning a callback from the
useSelect
hook.Why?
The
mapSelect
returns a new callback value on every call, and this can lead to unnecessary rerenders.Testing Instructions
Confirm "Copy all blocks" feature works as before in post and site editors.
Screenshots or screencast