Audit and better document the useNavigationMenu hook #67828
Labels
[Package] Block library
/packages/block-library
[Type] Bug
An existing feature does not function as intended
Description
Splitting this out from #67009 see relevant discussion there together with @ntsekouras and @draganescu
It appears there is some uncertainty about this hook expected behavior and that's in part because it is not documented at all.
From the conversation starting from
#67009 (comment) a few main points emerge:
isNavigationMenuMissing
is assumed to be true which is confusinga not necessarily always true.menuUnavailable
is working as intended or buggy.useNavigationMenu
returns information about all menus while instead, when the ID is passed, it returns information about a specific menu. To my understanding, that's not entirely true as it seems to me this hook returns information about all menus anyways.Overall, it seems there's some room for improvements. At the very least, some documentation should clarify this hook usage.
Step-by-step reproduction instructions
N/A
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: