-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block Editor: Improve data selector for BlockQuickNavigationItem #51429
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
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
|
alexstine
left a comment
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
BlockQuickNavigationItemto 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
mapSelectwill prevent unwanted rerenders.How?
__experimentalGetBlockLabelinside the selector.getBlockTypeselector.keyprop 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