Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@ export default function useAutocomplete(props) {

if (process.env.NODE_ENV !== 'production') {
if (typeof optionLabel !== 'string') {
const erroneousReturn = optionLabel === undefined ? 'undefined' : `${typeof optionLabel} (${optionLabel})`;
console.error(
[
'Material-UI: the `getOptionLabel` method of useAutocomplete do not handle the options correctly.',
`The component expect a string but received ${typeof optionLabel}.`,
`For the input option: ${JSON.stringify(
newValue,
)}, \`getOptionLabel\` returns: ${optionLabel}.`,
`Material-UI: the \`getOptionLabel\` method of Autocomplete returned ${erroneousReturn} instead of a string for`,
JSON.stringify(newValue),
].join('\n'),
);
}
Expand Down