Я сделал этот компонент
const AutocompleteAdapter = ({ input, ...rest }) => (
<Autocomplete
{...input}
{...rest}
forcePopupIcon={false}
renderInput={params => <TextField {...params} {...input} {...rest} />}
/>
);
и пытаясь отобразить его внутри
<Field
required
name="coach"
label="Coach"
type="text"
placeholder="Enter Coach"
helperText="coach's email"
validate={composeValidators(required, email)}
className={classes.field}
options={mockEmails}
getOptionLabel={option => option}
component={AutocompleteAdapter}
/>
Мой список mockEmails относится к этому типу -> const mockEmails = ['[email protected]', '[email protected]']
The list is rendered under the autocomplete field but when im typing it dont filter the results, and if i choose one mail of the list i get this error
Material-UI: the `getOptionLabel` method of useAutocomplete do not handle the options correctly.
The component expect a string but received number.
For the input option: 0, `getOptionLabel` returns: 0.