-
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
Update the registration examples to use apiVersion 2 #26100
Conversation
Size Change: -618 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
return <RichText.Content tagName="h2" value={ attributes.content } />; // Saves <h2>Content added in the editor...</h2> to the database for frontend display | ||
const blockProps = useBlockProps.save(); | ||
|
||
return <RichText.Content { ...blockProps } tagName="h2" value={ attributes.content } />; // Saves <h2>Content added in the editor...</h2> to the database for frontend display |
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.
Alternatively this could be <h2 {...blockProps}><RichText.Content value="" /></h2>
, but I don't mind either way.
Co-authored-by: Ella van Durpe <[email protected]>
var el = element.createElement, | ||
registerBlockType = blocks.registerBlockType, | ||
withSelect = data.withSelect; | ||
withSelect = data.withSelect, |
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.
Should we update to useSelect
too? Or maybe a separate PR.
This PR updates the block examples in our docs to use apiVersion: 2.
In addition to this PR, we'd need a few things:
useBlockProps
I think we should create PRs for this and merge them together once we get close to the WordPress 5.6 release (to avoid confusing the developpers).