Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is missing some ## :)


### Bug fixes

- Fix `instanceId` prop passed through to `Button` component via `MenuItems` producing React console error. [#14599](https://github.com/WordPress/gutenberg/pull/14599)

## 7.2.0 (2019-03-20)

### Improvements
Expand Down
7 changes: 6 additions & 1 deletion packages/components/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import { omit } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -42,9 +43,13 @@ export function Button( props, ref ) {
const tag = href !== undefined && ! disabled ? 'a' : 'button';
const tagProps = tag === 'a' ? { href, target } : { type: 'button', disabled };

const passThruProps = additionalProps.instanceId ?
omit( additionalProps, [ 'instanceId' ] ) :
additionalProps;

return createElement( tag, {
...tagProps,
...additionalProps,
...passThruProps,
className: classes,
ref,
} );
Expand Down