Skip to content

useDropZone: Refactor docs to use the correct function syntax #70286

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

yogeshbhutkar
Copy link
Contributor

What, Why, and How?

This PR updates the README for useDropZone to fix incorrect function syntax in the example code. Previously, the example used an invalid arrow function syntax onDrop() => {}, which is not valid JavaScript.

Ref.

onDrop() => {
console.log( 'Dropped within the drop zone.' );
},


Found this while trying to implement useDropZone.
bug


Incorrect Syntax:

onDrop() => {
  console.log( 'Dropped within the drop zone.' );
}

Valid Alternatives:

onDrop: () => {
  console.log( 'Dropped within the drop zone.' );
}
onDrop() {
  console.log( 'Dropped within the drop zone.' );
}

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review June 2, 2025 06:17
@yogeshbhutkar yogeshbhutkar requested a review from ajitbohra as a code owner June 2, 2025 06:17
Copy link

github-actions bot commented Jun 2, 2025

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: yogeshbhutkar <yogeshbhutkar@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.

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.

Good catch 👍

@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers [Package] Compose /packages/compose props-bot Adding this label triggers the Props Bot workflow for a PR. labels Jun 2, 2025
@github-actions github-actions bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Jun 2, 2025
@t-hamano t-hamano merged commit cab5fb5 into WordPress:trunk Jun 2, 2025
70 of 72 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.0 milestone Jun 2, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
Co-authored-by: yogeshbhutkar <yogeshbhutkar@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] Compose /packages/compose [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants