Skip to content

Commit 90ebd60

Browse files
author
Carlos Lancha
committed
fix: don't use useMemo
1 parent a5aefb2 commit 90ebd60

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

packages/clay-card/src/CardWithInfo.tsx

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ClayLabel from '@clayui/label';
1111
import ClayLayout from '@clayui/layout';
1212
import ClaySticker, {IClayStickerProps} from '@clayui/sticker';
1313
import classNames from 'classnames';
14-
import React, {useMemo} from 'react';
14+
import React from 'react';
1515

1616
import ClayCard from './Card';
1717

@@ -135,25 +135,15 @@ export const ClayCardWithInfo: React.FunctionComponent<IProps> = ({
135135
image: displayType === 'image' || imgProps,
136136
};
137137

138-
const contentSymbol = useMemo(() => {
139-
if (!symbol) {
140-
if (isCardType.image) {
141-
return 'camera';
142-
}
138+
const contentSymbol = symbol
139+
? symbol
140+
: isCardType.image
141+
? 'camera'
142+
: 'documents-and-media';
143143

144-
return 'documents-and-media';
145-
}
146-
147-
return symbol;
148-
}, [isCardType]);
149-
150-
const stickerSymbol = useMemo(() => {
151-
if (isCardType.image) {
152-
return 'document-image';
153-
}
154-
155-
return 'document-default';
156-
}, [isCardType]);
144+
const stickerSymbol = isCardType.image
145+
? 'document-image'
146+
: 'document-default';
157147

158148
const headerContent = (
159149
<ClayCard.AspectRatio className="card-item-first">

0 commit comments

Comments
 (0)