chore: remove unused ref (#203)

This commit is contained in:
Camila Sosa Morales 2023-04-05 15:55:47 -03:00 committed by GitHub
parent c1af8df24c
commit a4542d7442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 156 additions and 164 deletions

View File

@ -156,8 +156,7 @@ export type ComboboxProps = {
error?: boolean;
};
export const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
({
export const Combobox: React.FC<ComboboxProps> = ({
items,
selectedValue = { value: '', label: '' },
withAutocomplete = false,
@ -267,16 +266,13 @@ export const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
) : (
<>
{autocompleteItems.length > 0 && <span>Create new</span>}
{autocompleteItems.map(
(autocompleteOption: ComboboxItem) => (
{autocompleteItems.map((autocompleteOption: ComboboxItem) => (
<ComboboxOption
key={autocompleteOption.value}
option={autocompleteOption}
/>
)
)}
{autocompleteItems.length > 0 &&
filteredItems.length > 0 && (
))}
{autocompleteItems.length > 0 && filteredItems.length > 0 && (
<Separator css={{ mb: '$2' }} />
)}
{filteredItems.map((option: ComboboxItem) => (
@ -290,7 +286,6 @@ export const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
)}
</ComboboxLib>
);
}
);
};
Combobox.displayName = 'Combobox';

View File

@ -134,8 +134,7 @@ export abstract class Form {
}
);
static readonly Combobox = forwardRef<HTMLInputElement, Form.ComboboxProps>(
(props, ref) => {
static readonly Combobox: React.FC<Form.ComboboxProps> = (props) => {
const {
id,
validators,
@ -166,7 +165,6 @@ export abstract class Form {
return (
<Combobox
ref={ref}
{...props}
onChange={handleComboboxChange}
selectedValue={comboboxValue || ({} as ComboboxItem)}
@ -174,8 +172,7 @@ export abstract class Form {
error={validationEnabled && !isValid}
/>
);
}
);
};
static readonly ColorPicker: React.FC<Form.ColorPickerProps> = ({
logo,