🔧 chore: usememo dependencies

This commit is contained in:
Andre H 2024-02-22 14:20:26 +07:00
parent bb7a88f7e9
commit c8a153ad27

View File

@ -58,13 +58,16 @@ export const SimpleToast = ({
))}
</div>
) : null,
[],
[cta],
);
const renderCloseButton = () => (
const renderCloseButton = useMemo(
() => (
<div onClick={() => onDismiss(props.id)} className={closeIconCls()}>
<CrossIcon className="h-3 w-3" />
</div>
),
[],
);
return (
@ -75,7 +78,7 @@ export const SimpleToast = ({
<p className={titleCls()}>{title}</p>
</ToastPrimitive.Title>
{renderCta}
{renderCloseButton()}
{renderCloseButton}
</div>
</ToastPrimitive.Root>
);