WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

Fix: Direct import fails in block editor #67081

Closed haritpanchal closed 3 days ago

haritpanchal commented 4 days ago

What?

import { BoxControl } from '@wordpress/components';

Getting react minified error while following the above way.

Why?

import { __experimentalBoxControl as BoxControl } from '@wordpress/components';

This is the correct way but information is missing in document. This solved the minify error.

How?

Testing Instructions

  1. Add the BoxControl demo in your block as shows in current documentation
  2. Access your block in editor.
  3. Block will fail to load and console will show error. (Error: Minified React error #130)

Testing Instructions for Keyboard

Screenshots or screencast

github-actions[bot] commented 4 days ago

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: haritpanchal <haritpanchal@git.wordpress.org>

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

github-actions[bot] commented 4 days ago

:wave: Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @haritpanchal! 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.

Mamaduka commented 3 days ago

The BoxControl component is stable now, so the import in the documentation is correct. If you see errors, please update the WP to the latest version.

Ref: #65469.