Skip to content

Commit a555cee

Browse files
committed
Remove unneeded memoization
1 parent f783284 commit a555cee

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

packages/compass-components/src/components/actions/item-action-controls.tsx

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useMemo } from 'react';
1+
import React from 'react';
22
import { spacing } from '@leafygreen-ui/tokens';
33
import { css, cx } from '@leafygreen-ui/emotion';
44
import type { RenderMode } from '@leafygreen-ui/popover';
@@ -47,33 +47,19 @@ export function ItemActionControls<Action extends string>({
4747
collapseToMenuThreshold = 2,
4848
'data-testid': dataTestId,
4949
}: ItemActionControlsProps<Action>) {
50-
const sharedProps = useMemo(
51-
() => ({
52-
isVisible,
53-
onAction,
54-
className: cx('item-action-controls', className),
55-
iconClassName,
56-
iconStyle,
57-
iconSize,
58-
'data-testid': dataTestId,
59-
}),
60-
[
61-
isVisible,
62-
onAction,
63-
className,
64-
iconClassName,
65-
iconStyle,
66-
iconSize,
67-
dataTestId,
68-
]
69-
);
70-
const sharedMenuProps = useMemo(
71-
() => ({
72-
menuClassName,
73-
renderMode,
74-
}),
75-
[menuClassName, renderMode]
76-
);
50+
const sharedProps = {
51+
isVisible,
52+
onAction,
53+
className: cx('item-action-controls', className),
54+
iconClassName,
55+
iconStyle,
56+
iconSize,
57+
'data-testid': dataTestId,
58+
};
59+
const sharedMenuProps = {
60+
menuClassName,
61+
renderMode,
62+
};
7763

7864
if (actions.length === 0) {
7965
return null;

0 commit comments

Comments
 (0)