-
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
Block Editor: Improve data selector for BlockQuickNavigationItem #51429
Conversation
return ( | ||
<Button | ||
key={ clientId } |
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.
A small clean-up.
Size Change: +8 B (0%) Total Size: 1.4 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.
Code looks clean but you should probably get one further review.
Flaky tests detected in 9adce28. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5247674975
|
Thank you, @alexstine! @noisysocks, I added the screencast to highlight the difference better. |
Nice 🎉 |
…dPress#51429) * Block Editor: Improve data selector for BlockQuickNavigationItem * Remove unnecessary 'key' prop
What?
This is a follow-up to #51281.
PR updates the selector in
BlockQuickNavigationItem
to only return data needed for rendering.Why?
The block attributes change often, and not every block has special handlers for the label. Returning the block name from the
mapSelect
will prevent unwanted rerenders.How?
__experimentalGetBlockLabel
inside the selector.getBlockType
selector.key
prop for the button.Testing Instructions
Screenshots or screencast
Before
CleanShot.2023-06-13.at.08.39.25.mp4
After
CleanShot.2023-06-13.at.08.41.20.mp4