Repository navigation
Navigation: Don't create duplicate navigation menus - #48599
Merged
Merged
Conversation
draganescu
approved these changes
Feb 28, 2023
draganescu
left a comment
Contributor
There was a problem hiding this comment.
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.
scruffian
enabled auto-merge (squash)
February 28, 2023 16:02
|
Size Change: -1 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Contributor
|
Now that #48219 is merged should we revert this? |
Contributor
Author
|
Done in #49291 |
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This is just a quick fix for an issue where duplicate navigation menus are created from the fallback. Ideally we should be providing
blocksas a dependency to thisuseEffectbut 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
useEffectbut that PR might take some time to get right, so in the meantime I suggest we just remove theblocksdependency.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast