-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
InnerBlocks: fix continuous re-rendering on inner blocks change #58348
Conversation
Size Change: -25 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in deb0e11. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7678293373
|
@@ -112,5 +110,5 @@ export default function useInnerBlockTemplateSync( | |||
return () => { | |||
isCancelled = true; | |||
}; | |||
}, [ innerBlocks, template, templateLock, clientId ] ); | |||
}, [ template, templateLock, clientId ] ); |
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.
Note the condition on this line:
Nothing happens unless the template changed.
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 really cool one :)
Really strange that there's no improvement in the last run, let's see code vitals I guess |
What?
Currently when typing in a list (or any block using inner block such as group, quote, etc.) the whole list re-renders. This is because all inner blocks hooks are subscribed to their inner blocks.
Subscribing to inner blocks doesn't seem to be needed because
useInnerBlockTemplateSync
does nothing unless the template changes.Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast