Skip to content
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

Docs: Example code of adding innerBlocks to Block Preview is incorrect. #23898

Closed
naogify opened this issue Jul 13, 2020 · 0 comments
Closed
Labels
[Type] Developer Documentation Documentation for developers

Comments

@naogify
Copy link
Contributor

naogify commented Jul 13, 2020

Describe the bug

The example section in block registration document, it use object expression, like innerBlocks: { ... } to adding innerBlocks for previewing.
I got Cannot read property 'attributes' of undefined error, by following the way above.

But, I found the the core/cover block use array expression, like innerBlocks: [ ... ] . It works well.
https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/cover/index.js#L32

We should fix the example code in the document , from innerBlocks: { ... }. to innerBlocks: [ ... ].

To reproduce
Adding innerBlocks for block example in block registration by innerBlocks: { ... } .

Expected behavior
Can see Block Preview.

Screenshots
none

Editor version (please complete the following information):

  • WordPress version: 5.4.2
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default?: "default"

Desktop (please complete the following information):

  • OS: [macOS Mojave]
  • Browser [chrome]
  • Version [10.14.6]

Smartphone (please complete the following information):
none

Additional context
none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

3 participants