-
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
Is it possible to use Inner Blocks in a dynamic block? #7785
Comments
Hi @nyordanov you can use the withSelect HOC https://wordpress.org/gutenberg/handbook/packages/packages-data/#withselect-mapselecttoprops-function-function to get a prop with all the inner blocks. The prop is updated each time the inner blocks are modified.
If you need to be notified outside of a React component you can subscribe to the store https://wordpress.org/gutenberg/handbook/packages/packages-data/#subscribe-function. I hope this answers your question and I'm closing this issue for now if you need additional information, feel free to reopen it. |
@jorgefilipecosta any chance this will become available to server rendered blocks again? Would be great if blocks were rendered from the inside out, and the rendered markup was made available up the chain. |
yes please this is so important. |
@jorgefilipecosta How can we render blocks that we get from |
If there is a need to get the content string of a block whose id was retrieved from withSelect I guess we can explicitly call wp.blocks.serialize and pass an array with that block. But I think that is something that should be avoided, maybe there is another way to solve the use-case. |
How do I get the contents of
InnerBlocks
without usingInnerBlocks.Content
? Is there any event, which is fired when the inner blocks are modified?The text was updated successfully, but these errors were encountered: