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 react warning for instanceId prop on a DOM element (<Button> component) #14599

Merged
merged 7 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ReusableBlockDeleteButton matches the snapshot 1`] = `
<WithInstanceId(MenuItem)
<MenuItem
className="editor-block-settings-menu__control block-editor-block-settings-menu__control"
disabled={false}
icon="no"
onClick={[Function]}
>
Remove from Reusable Blocks
</WithInstanceId(MenuItem)>
</MenuItem>
`;
6 changes: 6 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 7.2.1 (Unreleased)

### Bug fixes

- Fix `instanceId` prop passed through to `Button` component via `MenuItems` producing React console error. Fixed by removing the unnecessary use of `withInstanceId` on the `MenuItems` component [#14599](https://github.com/WordPress/gutenberg/pull/14599)

## 7.2.0 (2019-03-20)

### Improvements
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/menu-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { isString } from 'lodash';
* WordPress dependencies
*/
import { createElement, cloneElement } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down Expand Up @@ -77,4 +76,4 @@ export function MenuItem( {
);
}

export default withInstanceId( MenuItem );
export default MenuItem;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ exports[`PluginMoreMenuItem renders menu item as button properly 1`] = `
>
<button
className="components-button components-icon-button components-menu-item__button has-icon has-text"
instanceId={0}
onClick={[Function]}
role="menuitem"
type="button"
Expand Down