-
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
Blocks: fix block variation name checking #64818
base: trunk
Are you sure you want to change the base?
Blocks: fix block variation name checking #64818
Conversation
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. |
Thanks for contributing, @meteorlxy! As the function name suggests, the I think we should first consider whether we want to support or discourage this behavior. |
@Mamaduka Oh didn't know that. The types definition in the Then maybe creating official typings would help discourage this behavior |
JSDoc states that it accepts a variation object: gutenberg/packages/blocks/src/api/registration.js Lines 702 to 703 in 57c9c69
|
What?
When registering block variations in array:
There would always have a warning in console:
Why?
Fix the wrong warning
How?
Check if the variation param is an array or not
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast