-
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
Navigation: Don't create duplicate navigation menus #48599
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.
This is a temporary fix for a bug that should be avoided in the next Gutenberg release. The proper fix is impossible to land in time, and this deps removal should fix the problem temporarily without - in my testing - causing other issues.
Size Change: -1 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Now that #48219 is merged should we revert this? |
Done in #49291 |
What?
This is just a quick fix for an issue where duplicate navigation menus are created from the fallback. Ideally we should be providing
blocks
as a dependency to thisuseEffect
but at the moment this causes a duplicate navigation menu to be created because blocks get mutated by thisuseEffect
:gutenberg/packages/block-library/src/navigation-link/edit.js
Line 234 in 7d8c488
I am proposing in #48219 that we remove this
useEffect
but that PR might take some time to get right, so in the meantime I suggest we just remove theblocks
dependency.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast