Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
remove lodash dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed Dec 20, 2019
1 parent aa0c1a2 commit 46c8adb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/js/base/components/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { useState, useEffect } from '@wordpress/element';
import { find, partial } from 'lodash';
import { withInstanceId } from '@wordpress/compose';
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -61,7 +60,7 @@ const Tabs = ( {
setSelected( tabKey );
onSelect( tabKey );
};
const selectedTab = find( tabs, { name: selected } );
const selectedTab = tabs.find( ( tab ) => tab.name === selected );
if ( ! selectedTab ) {
throw new Error( 'There is no available tab for the selected item' );
}
Expand All @@ -87,7 +86,7 @@ const Tabs = ( {
selected={ tab.name === selected }
key={ tab.name }
ariaLabel={ tab.ariaLabel || null }
onClick={ partial( handleClick, tab.name ) }
onClick={ () => handleClick( tab.name ) }
>
{ tab.title() }
</TabButton>
Expand Down

0 comments on commit 46c8adb

Please sign in to comment.