-
Notifications
You must be signed in to change notification settings - Fork 313
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 Inner Blocks (ESNext) to use latest API #163
Conversation
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's great to see all those updates 👍🏻
const { name, ...settings } = json; | ||
|
||
registerBlockType( name, { | ||
...settings, |
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.
One note. Technically speaking, you don't need to spread settings here. They are exposed from the server when registered with register_block_type
.
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.
Thanks for confirming that! It was a question that came up in a couple of live streams.
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.
That means that whatever the client provides overrides what the server provides (if registered also on the server).
If you register blocks only with JavaScript then you surely need to spread settings from block.json
here.
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.
Example for core blocks:
It's only settings specific to the client (UI).
Part of the effort in #152