Skip to content

Commit

Permalink
Add deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
milesdelliott authored Sep 18, 2018
1 parent a724dbb commit 27b4423
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/components/src/tab-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { partial, noop, find } from 'lodash';
*/
import { Component } from '@wordpress/element';
import { withInstanceId } from '@wordpress/compose';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand Down Expand Up @@ -63,6 +64,13 @@ class TabPanel extends Component {

const selectedTab = find( tabs, { name: selected } );
const selectedId = instanceId + '-' + selectedTab.name;

deprecated( 'Tab Panel child function argument used as string', {
alternative: "Argument is now an object, access the name property directly.",
version: '4.0.0',
plugin: 'Gutenberg',
hint: 'This is a global warning, shown regardless of whether the component is used.',
} );

return (
<div className={ className }>
Expand Down

0 comments on commit 27b4423

Please sign in to comment.