mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 19:29:39 -06:00
Moved the evaluation in start of the render option execution.
This commit is contained in:
@@ -154,6 +154,7 @@ const Search = ({
|
||||
}}
|
||||
renderOption={(props, option) => {
|
||||
const { key, ...optionProps } = props;
|
||||
const hasSecondaryLabel = secondaryLabel && option[secondaryLabel] !== undefined;
|
||||
return (
|
||||
<ListItem
|
||||
key={key}
|
||||
@@ -168,9 +169,7 @@ const Search = ({
|
||||
}
|
||||
>
|
||||
{option[filteredBy] +
|
||||
(secondaryLabel && option[secondaryLabel]
|
||||
? ` (${option[secondaryLabel]})`
|
||||
: "")}
|
||||
(hasSecondaryLabel ? ` (${option[secondaryLabel]})` : "")}
|
||||
</ListItem>
|
||||
);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user