-
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
Nav block: extract hook for inner blocks #42743
Nav block: extract hook for inner blocks #42743
Conversation
const hasSubmenus = !! innerBlocks.find( | ||
( block ) => block.name === 'core/navigation-submenu' | ||
); |
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.
This concept of "submenus" was previously baked into the useSelect
which handled information about inner blocks.
I find the concept to be unrelated to the extent that it should not be included in the hook.
Size Change: +8 B (0%) Total Size: 1.26 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.
LGTM
af8bbe9
to
3573125
Compare
Waiting on tests... |
What?
Extracts a new hook for handling inner blocks related things.
Also removes unrelated concept of "submenus" from scope of the exported data.
Why?
Having this within the body of the
edit.js
file was making it very verbose and noisy. This PR reduces noisy and is part of an effort to make the block more approachable by codify concepts.How?
Extracts a custom hook for inner blocks related things.
Testing Instructions
Basically check the block doesn't break in any major way.
Especially worth checking that submenus still work as expected.
Screenshots or screencast