-
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
Rich text: avoid block editor subscription if not selected #57226
Conversation
Size Change: +20 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
if ( ! isBlockSelected ) { | ||
return { isSelected: false }; | ||
} | ||
|
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.
Some of the "if" checks under this can be simplified now no?
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 don't think so? It checks if the rich text instance is selected, it doesn't involve the block selection check
What?
While this does not remove a
useSelect
call per block, it should remove a subscription to the bock editor store per block.Why?
1st run: -8.4% (type)
2nd run: -3.0%
3rd: -6.2%
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast