-
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
DownloadableBlocksPanel: remove withSelect in favor of useSelect #58109
Conversation
Size Change: -6 B (0%) Total Size: 1.7 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.
Thank you, @jsnajdr!
The refactoring looks good to me, and the block directory feature works as before.
@@ -35,7 +29,6 @@ function InserterMenuDownloadableBlocksPanel() { | |||
<DownloadableBlocksPanel | |||
onSelect={ onSelect } | |||
onHover={ onHover } | |||
rootClientId={ rootClientId } |
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.
Nice!
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.
Yes, the prop was not used 🙂
Fixing something I noticed when discussing #58058:
DownloadableBlocksPanel
is a functional component and yet it useswithSelect
. This PR migrates that to a custom hook withuseSelect
.How to test: Open block inserter in the left sidebar. Try to search for something. Verify that you are offered a list of downloadable matching blocks from the WP.org registry.