-
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
Documenting innerBlocks in save function #66689
Conversation
There is an undocumented property 'innerBlocks' of props passed to save function. This change attempts to document it with example of use.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Nice addition, thank you for contributing these explanation.
|
||
|
||
```jsx | ||
save: ( { attributes, innerBlocks } ) => { |
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.
It looks like it's a convenient alternative to another way to check inner blocks:
gutenberg/packages/block-library/src/gallery/save.js
Lines 24 to 29 in c979084
const blockProps = useBlockProps.save( { className } ); | |
const innerBlocksProps = useInnerBlocksProps.save( blockProps ); | |
return ( | |
<figure { ...innerBlocksProps }> | |
{ innerBlocksProps.children } |
I'm not entirely sure what the difference exactly is. However, I wanted to document it for completeness.
There is an undocumented property 'innerBlocks' of props passed to save function. This change attempts to document it with example of use.
What?
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast