-
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
Site Editor: Fix incorrect 'useSelect' usage #52683
Conversation
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.
LGTM. Thanks for fixing.
Size Change: 0 B Total Size: 1.43 MB ℹ️ View Unchanged
|
Flaky tests detected in cbf199e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5575258854
|
* trunk: (36 commits) Use `_get_block_template_file` function and set $area variable. (#52708) Change Delete page menu item to Move to trash. (#52641) Search block: Enqueue view script through block.json (#52552) Patterns: fix bug with Create Patterns menu not showing in site editor page editing (#52671) Github workflow: add a PHP backport changes action (#52096) Add layout API documentation. (#52673) Show uncategorized patterns on the Editor > Patterns page (#52633) Patterns: Remove `reusable` text from menu once rename hint has been dismissed (#52664) Update locked pattern tooltips (#52497) Rich Text/Footnotes: fix getRichTextValues for useInnerBlocksProps.save (#52682) Use posts instead of template parts for navigation color tests (#52654) Site Editor: Don't allow creating template part on the Patterns page for non-block themes (#52656) Site Editor: Fix incorrect 'useSelect' usage (#52683) Update issue gardening automation with new label (#52173) i18n: Make the tab labels of `ColorGradientSettingsDropdown` component translatable (#52669) Post Content link color should not be applied to placeholder component links (#52367) [Mobile] Update toolbar icons and colors (#52336) Avoid copying global style presets via the styles compatibility hook (#52640) Show warning on removal of Post Template block in the site editor. (#52666) Backport tools: sort PRs to be cherry picked by merged/closed date (#52667) ...
What?
This is a follow-up to #50863.
PR fixes an incorrect
useSelect
usage in theEntitiesSavedStatesForPreview
component.Why?
The render function shouldn't call the selectors directly to avoid stale values. While state values will rarely visible in this case, it promotes a bad practice in the core.
See: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#useselect
Testing Instructions
Screenshots or screencast