From 69f2a35782624557cbbd41c223c177c3f6ff0713 Mon Sep 17 00:00:00 2001 From: Kirill Revenkov Date: Fri, 5 Apr 2024 19:03:51 +0300 Subject: [PATCH] chore: use ternanry --- .../Select/components/SelectControl/SelectControl.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Select/components/SelectControl/SelectControl.tsx b/src/components/Select/components/SelectControl/SelectControl.tsx index 5f77482b62..09d361cf9b 100644 --- a/src/components/Select/components/SelectControl/SelectControl.tsx +++ b/src/components/Select/components/SelectControl/SelectControl.tsx @@ -117,10 +117,9 @@ export const SelectControl = React.forwardRef(( } const count = Number(value?.length) || 0; const counterComponent = ; - if (renderCounter) { - return renderCounter(counterComponent, {count, size, disabled}); - } - return counterComponent; + return renderCounter + ? renderCounter(counterComponent, {count, size, disabled}) + : counterComponent; }; const renderClearIcon = (args: SelectRenderClearArgs) => {