mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-10 14:22:46 +02:00
optimize various base components
This commit is contained in:
@@ -67,16 +67,13 @@ export const MultiSelectWithInvalidData = ({ data, defaultValue, ...props }: Mul
|
||||
return [data, []];
|
||||
}, [data, defaultValue]);
|
||||
|
||||
return (
|
||||
<MultiSelect
|
||||
data={fullData}
|
||||
defaultValue={defaultValue}
|
||||
error={
|
||||
missing.length
|
||||
? t('error.badValue', { postProcess: 'sentenceCase', value: missing })
|
||||
: undefined
|
||||
}
|
||||
{...props}
|
||||
/>
|
||||
const error = useMemo(
|
||||
() =>
|
||||
missing.length
|
||||
? t('error.badValue', { postProcess: 'sentenceCase', value: missing })
|
||||
: undefined,
|
||||
[missing, t],
|
||||
);
|
||||
|
||||
return <MultiSelect data={fullData} defaultValue={defaultValue} error={error} {...props} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user