Skip to content

Commit

Permalink
Remove unneeded memoization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Dec 19, 2024
1 parent c574065 commit 0bcf8b4
Showing 1 changed file with 13 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,19 @@ export function ItemActionControls<Action extends string = string>({
collapseToMenuThreshold = 2,
'data-testid': dataTestId,
}: ItemActionControlsProps<Action>) {
const sharedProps = useMemo(
() => ({
isVisible,
onAction,
className: cx('item-action-controls', className),
iconClassName,
iconStyle,
iconSize,
'data-testid': dataTestId,
}),
[
isVisible,
onAction,
className,
iconClassName,
iconStyle,
iconSize,
dataTestId,
]
);
const sharedMenuProps = useMemo(
() => ({
menuClassName,
renderMode,
}),
[menuClassName, renderMode]
);
const sharedProps = {
isVisible,
onAction,
className: cx('item-action-controls', className),
iconClassName,
iconStyle,
iconSize,
'data-testid': dataTestId,
};
const sharedMenuProps = {
menuClassName,
renderMode,
};

if (actions.length === 0) {
return null;
Expand Down

0 comments on commit 0bcf8b4

Please sign in to comment.