I have made this Component
const AutocompleteAdapter = ({ input, ...rest }) => (
<Autocomplete
{...input}
{...rest}
forcePopupIcon={false}
renderInput={params => <TextField {...params} {...input} {...rest} />}
/>
);
and trying to render it inside the
<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}
/>
My mockEmails list is of this type --> const mockEmails = ['name@gmail.com', 'name2@gmail.com']
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.