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

Fix example of useBlockProps hook #64363

Merged
merged 4 commits into from
Aug 11, 2024

Conversation

meteorlxy
Copy link
Contributor

What?

Fix example of useBlockProps hook in the readme file

Why?

The example code is wrong. The wrapper { } of the object is missing.

How?

Wrap the object with { } correctly

Testing Instructions

N/A

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@meteorlxy meteorlxy requested a review from ellatrix as a code owner August 8, 2024 02:51
Copy link

github-actions bot commented Aug 8, 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: meteorlxy <meteorlxy@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@Mamaduka Mamaduka added the [Type] Developer Documentation Documentation for developers label Aug 8, 2024
@t-hamano t-hamano self-requested a review August 8, 2024 04:06
@t-hamano t-hamano added the [Package] Block editor /packages/block-editor label Aug 8, 2024
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

The API documentation is auto-generated from JSDoc, so you need to fix it here:

* const blockProps = useBlockProps(
* className: 'my-custom-class',
* style: {
* color: '#222222',
* backgroundColor: '#eeeeee'
* }
* )

After making changes, run npm run docs:build. Then commit and push those changes.

@meteorlxy meteorlxy requested a review from t-hamano August 10, 2024 02:54
@meteorlxy
Copy link
Contributor Author

@t-hamano Thanks for the guidance! Updated.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@t-hamano t-hamano merged commit e0b54b3 into WordPress:trunk Aug 11, 2024
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 11, 2024
getdave pushed a commit that referenced this pull request Aug 14, 2024
* Fix example of useBlockProps hook

* chore: tweaks

* chore: updates

Co-authored-by: meteorlxy <meteorlxy@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants