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: Fix missing braces into code snippet #61839

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

HelloAlberuni
Copy link

The parameters of useBlockProps should be an object otherwise it generates error.

What?

It adds the missing braces to code snippets using the useBlockProps hook.

Why?

The parameters of the useBlockProps hook must be an object; otherwise, it will throw an error in the console. I've seen another code snippet [in this doc](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#block-wrapper-props passed) passed an object which is the right way.

The parameters of useBlockProps should be an object otherwise it generates error.
Copy link

github-actions bot commented May 22, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: HelloAlberuni <alberuni-azad@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @HelloAlberuni! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 22, 2024
@Mamaduka Mamaduka added the [Type] Developer Documentation Documentation for developers label May 22, 2024
@Mamaduka
Copy link
Member

Thanks for fixing the docs, @HelloAlberuni!

This particular example is auto-generated, and you'll need to fix it in this file https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/block-list/use-block-props/index.js#L52-L58.

Before committing the changes, make sure to run - the npm run docs:build command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants