InnerBlocks are being removed and added again in React DOM with templateLock="contentOnly"
#50163
Labels
[Feature] Block Locking
The API allowing for the ability to lock/unlock blocks
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
[Type] Performance
Related to performance efforts
Description
Currently when rendering inner blocks within a
templateLock="contentOnly"
block, the React dom nodes are initially rendered, then removed, and then rendered again. This only appears to happen whentemplateLock
is set tocontentOnly
, setting it to any of the other values, it correctly renders once.This is causing some un-expected behaviour for us as we make use of SlotFills within the inner blocks, which also end up being removed and re-added. This is noticeable when the page is being rendered.
I expect the inner blocks content to be only rendered once.
Step-by-step reproduction instructions
wp-content/mu-plugins
folder.blocks.js
file and remove the use oftemplateLock="contentOnly"
and go to Books > Add NewScreenshots, screen recording, code snippet
Gist used: https://gist.github.com/louwie17/20328e1d2c723e34e9cb979dd156fe47
Kapture.2023-04-28.at.12.04.09.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: