Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
ItemGroup: Remove unneeded typecasting
  • Loading branch information
mirka committed Apr 19, 2024
commit b19f87324dadcfb569ae8386b57164aa5f7dfc37
11 changes: 1 addition & 10 deletions packages/components/src/item-group/item/hook.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import type { ElementType } from 'react';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -32,11 +27,7 @@ export function useItem( props: WordPressComponentProps< ItemProps, 'div' > ) {

const size = sizeProp || contextSize;

const as =
asProp ||
( ( typeof onClick !== 'undefined'
? 'button'
: 'div' ) as ElementType );
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed unnecessary type cast.

const as = asProp || ( typeof onClick !== 'undefined' ? 'button' : 'div' );

const cx = useCx();

Expand Down