Passing custom props to <InnerBlocks.Content/> #37415
-
Is it possible to pass custom props to InnerBlocks/InnerBlocks.Content ? The below does not work. I want to send some props from my parent component to my child component.
|
Beta Was this translation helpful? Give feedback.
Answered by
fabiankaegy
Dec 16, 2021
Replies: 1 comment 7 replies
-
@Jonofat Instead of using the You can see an example of it here: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/query/save.js The |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
fabiankaegy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Jonofat Instead of using the
<InnerBlocks.Content />
component you can use theuseInnerBlockProps.save()
hook.You can see an example of it here: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/query/save.js
The
useInnerBlocksProps
hook allows you to pass custom attributes to your components