-
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
BlockTitle: avoid re-render on attributes change #32118
Conversation
Size Change: -38 B (0%) Total Size: 1.86 MB
ℹ️ View Unchanged
|
@ramonjd, I think some of these optimizations could apply to the new |
Thanks for the ping. It definitely makes sense to encapsulate some of that logic in the selector. And it looks neater. :) I've started it off over at https://github.com/WordPress/gutenberg/pull/40004/files The tests will have to be refactored significantly to cover the logic as well. I'd be interested to know if it's something that is causing issues. I guess not since the PR description doesn't mention it. I've done a small comparison using Flamegraph and the visual render tool, and I can't see where we're triggering Block Title re-renders in trunk and with the changes. |
Description
Just a small optimisation. The block attributes object should not be returned by the selector.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).